mirror of https://github.com/zulip/zulip.git
c6d196a22f
This schema migration is only for use in automated migrations. To deploy on the production database (the migration only needs to be done once for both of staging and prod because they share a database), you should instead execute the following SQL manually: $ ssh postgres.humbughq.com $ psql humbug=> CREATE INDEX CONCURRENTLY zephyr_message_full_text_idx ON zephyr_message USING gin(to_tsvector('english', subject || ' ' || content)); Note the addition of the "CONCURRENTLY" keyword. The problem is that creating the index takes non-trivial time and requires a write lock on the table while the index is being created. This would mean that users would be unable to send messages while we were generating the index, which isn't acceptable. We can't create the index concurrently in the South migration because concurrent index creations can't happen inside of a transaction and South forces a transaction on migration functions. Also note that this index must be created before Postgres full text search is deployed to the app because full text search without an index is actually much slower than plain search using the LIKE operator. (imported from commit 8b9445c27d0e427278de997b22342bffe6d855b7) |
||
---|---|---|
.. | ||
0001_initial.py | ||
0002_auto__add_field_preregistrationuser_referred_by__add_field_preregistra.py | ||
0003_auto__add_field_stream_invite_only.py | ||
0004_add_postgres_zephyr_message_full_text_idx.py | ||
__init__.py |