plots2 icon indicating copy to clipboard operation
plots2 copied to clipboard

Adding indexes to appropriate columns of the database

Open shubhscoder opened this issue 7 years ago • 3 comments

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!

shubhscoder avatar Dec 31 '18 09:12 shubhscoder

I have identified these tables where we could index some columns :

  1. Images table (uid and nid together)
  2. 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)
  3. 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?

shubhscoder avatar Jan 04 '19 10:01 shubhscoder

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 :

  1. Images table (uid and nid together)
  2. 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)
  3. 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 .

jywarren avatar Jan 04 '19 14:01 jywarren

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 :

  1. Images table (uid and nid together)
  2. 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)
  3. 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 .

shubhscoder avatar Jan 04 '19 15:01 shubhscoder