Project

General

Profile

Actions

Feature proposal #7119

open

Further improve SQL structure

Added by krileon over 3 years ago.

Status:
Assigned
Priority:
Normal
Assignee:
Target version:
Start date:
16 April 2018
Due date:
% Done:

0%

Estimated time:

Description

The database structure of some tables can be improved further to increase performance. Changes suggested as follows.

_comprofiler_plugin_activity_following
Remove the id column and make user_id | asset a unique index. A user can only follow an asset once. id primary key doesn't make any sense here.

_comprofiler_plugin_activity_hidden
Same here. Remove primary key id and add unique index on user_id | type | item as you can't hide the same thing twice.

_comprofiler_plugin_activity_likes
Again, same. Remove primary key id and add unique index on user_id | asset as you can't like the same asset twice.

I would like to do the same for tags, but since tags accepts tagging someone that isn't a user (e.g. tagging a name) it won't be possible to index that unique by user_id | asset | tag. Also if #6969 doesn't happen then give the read table same unique index treatment.

All the above changes need significant testing to ensure they'll actually bring performance gains.

No data to display

Actions

Also available in: Atom PDF