zulip/zerver
Alex Vandiver 3518d31797 migrations: Add indexes with realm_id.
This is designed to help PostgreSQL have better specificity and
locality in its indexes.  Subsequent commits will adjust the code to
make sure that we use these indexes rather than the `realm_id`-less
versions.

We do not add a `realm_id` variation to the full-text index, since
it is a GIN index; multi-column GIN indexes are not terribly
performant, require the `btree_gin` extension for `int` types (which
requires superuser privileges on PostgreSQL 12 and earlier), and
cannot be consistently added concurrently on running instances.

After all indexes have been made, we also run `CREATE STATISTICS` in
order to give PostgreSQL the opportunity to realize that recipient and
sender are highly correlated with message realm, allowing it to
estimate that `(realm_id, recipient_id)` is likely as specific as
matching a given `recipient_id`, instead of as likely as matching
`realm_id` times matching a `recipient_id`.  Finally, those statistics
must be filled by `ANALYZE zerver_message`, which is run last.
2023-09-11 15:00:37 -07:00
..
actions django: Use .exists() instead of .count() when possible. 2023-09-11 15:00:37 -07:00
data_import ruff: Fix PERF102 Using only the keys/values of a dict. 2023-08-07 17:23:55 -07:00
integration_fixtures/nagios
lib coverage: Skip zerver.lib.migrate coverage. 2023-09-11 15:00:37 -07:00
management django: Use .exists() instead of .count() when possible. 2023-09-11 15:00:37 -07:00
migrations migrations: Add indexes with realm_id. 2023-09-11 15:00:37 -07:00
openapi events: Send invites changes event to non-admin users also. 2023-09-07 14:21:01 -07:00
tests migrations: Add indexes with realm_id. 2023-09-11 15:00:37 -07:00
tornado notifications: Rename 'pm' to 'dm' in 'RecipientInfoResult' dataclass. 2023-08-10 17:41:49 -07:00
transaction_tests docs: Fix typos caught by ‘typos’. 2023-09-06 18:59:05 -07:00
views users: Refactor and optimize max_message_id_for_user by removing a join. 2023-09-11 15:00:37 -07:00
webhooks webhooks: Migrate travis to use @typed_endpoint. 2023-09-08 08:20:17 -07:00
worker migration: Rename extra_data_json to extra_data in audit log models. 2023-08-16 17:18:14 -07:00
__init__.py
apps.py requirements: Upgrade Python requirements. 2023-04-03 22:39:21 -07:00
context_processors.py emails: Add corporate_enabled to context for emails. 2023-05-01 10:32:43 -07:00
decorator.py logging_util: Remove dependence on get_current_request. 2023-07-11 22:23:47 -07:00
filters.py error_notify: Remove custom email error reporting handler. 2023-07-20 11:00:09 -07:00
forms.py python: Convert translated positional {} fields to {named} fields. 2023-07-18 15:19:07 -07:00
logging_handlers.py error_notify: Remove custom email error reporting handler. 2023-07-20 11:00:09 -07:00
middleware.py middleware: Fix exception logging format on JSON views. 2023-09-06 09:14:49 -07:00
models.py migrations: Add indexes with realm_id. 2023-09-11 15:00:37 -07:00
signals.py demo-orgs: Create dev environment demo organization without email. 2023-08-31 15:02:16 -07:00