Adding indexes to appropriate columns of the database
Subpart of #4362
So basically, the aim of this issue is to identify potential columns of the database tables that can be indexed. This is an attempt to somehow speedup the loading of public labs website. I think we can make a list of all possible places where tables can be indexed and open multiple related sub issues of this. Thank you!
I have identified these tables where we could index some columns :
- Images table (uid and nid together)
- Likes tables (likeable_id and user_id) (Maybe currently we dont query this table much, but in future we may when we implement some kind of analysis)
- The node access table. (I havent seen this table being used anywhere, So I am trying to understand what is this used for.)
Rest of tables have already been indexed properly. @jywarren @gauravano do you think there is something that can be done here?
That sounds good! Would you open a pull request with a migration to add these? There are a few examples of index migrations in /db/migrate you can look at for an example. Thanks!
On Fri, Jan 4, 2019, 5:33 AM Shubham Sangamnerkar <[email protected] wrote:
I have identified these tables where we could index some columns :
- Images table (uid and nid together)
- Likes tables (likeable_id and user_id) (Maybe currently we dont query this table much, but in future we may when we implement some kind of analysis)
- The node access table. (I havent seen this table being used anywhere, So I am trying to understand what is this used for.)
Rest of tables have already been indexed properly. @jywarren https://github.com/jywarren @gauravano https://github.com/gauravano do you think there is something that can be done here?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/4478#issuecomment-451408719, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJz6PsybDu70VuZVi0GFibaJF_f5nks5u_y33gaJpZM4ZlTvK .
Yes sure I will open a PR. Thank you!
On Fri, Jan 4, 2019, 7:36 PM Jeffrey Warren [email protected] wrote:
That sounds good! Would you open a pull request with a migration to add these? There are a few examples of index migrations in /db/migrate you can look at for an example. Thanks!
On Fri, Jan 4, 2019, 5:33 AM Shubham Sangamnerkar < [email protected] wrote:
I have identified these tables where we could index some columns :
- Images table (uid and nid together)
- Likes tables (likeable_id and user_id) (Maybe currently we dont query this table much, but in future we may when we implement some kind of analysis)
- The node access table. (I havent seen this table being used anywhere, So I am trying to understand what is this used for.)
Rest of tables have already been indexed properly. @jywarren https://github.com/jywarren @gauravano https://github.com/gauravano do you think there is something that can be done here?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <https://github.com/publiclab/plots2/issues/4478#issuecomment-451408719 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AABfJz6PsybDu70VuZVi0GFibaJF_f5nks5u_y33gaJpZM4ZlTvK
.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/4478#issuecomment-451452406, or mute the thread https://github.com/notifications/unsubscribe-auth/ARofxUfecPXmYtSQtpJFtaNDCAfRo9Nkks5u_1_pgaJpZM4ZlTvK .