-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize autocomplete on edit committee page #84
Comments
Look at the query used, use |
@anandology I have made a small change to the query, which seems to have helped. Do we have some bigger data to test this ?
|
@anandology For indexing, we can take advantage of gin index in postgresql for which we need to enable extension. References
Any suggestions / roadblocks ? |
@anandology please review and merge. For deployment, all need to done is run the migration. |
Query Plan:
|
Is this after creating the index or before creating the index? The query plan doesn't seem to be using the index. It is still doing seq scan. |
Try with the following simple query:
With GIN index, it seems to be using the index.
However, if we use
The number of rows also matters in the query plan. Unless you have good enough rows, it thinks that seq scan is not that expensive. I've added lot of rows using the following:
That added a quarter million rows to the |
@anandology I tried all the suggestion, and tried to add the lower function in the index, but the index created with it is never been hit upon search. Seems some thing is not right, might be related to the text / string difference. I do have updated the code, to easy to switch to lower function by just uncommenting. I am using this codebase as reference Let me know if you have any suggestions. |
The autocomplete could be very slow when there are many rows in the member table. We need to add the required indexes on that table.
The text was updated successfully, but these errors were encountered: