-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: Add index for
EventProperty.property
(#22157)
* perf: Add index for `EventProperty.property` * Include `team_id` in index * Simplify definitions SQL This will make it simpler for Postgres to plan efficiently. * Revert "Simplify definitions SQL" We still need the `DISTINCT`. Hopefully Postgres still plans well.
- Loading branch information
Showing
3 changed files
with
19 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Created manually on 2024-04-10 18:46 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
atomic = False | ||
dependencies = [ | ||
("posthog", "0410_action_steps_population"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunSQL( | ||
"CREATE INDEX CONCURRENTLY posthog_eventproperty_team_id_and_property_r32khd9s ON posthog_eventproperty(team_id, property)", | ||
reverse_sql='DROP INDEX "posthog_eventproperty_team_id_and_property_r32khd9s"', | ||
), | ||
] |