Naz
Naz

Reputation: 13

Flag module causes excessive rows (more than 1million) in database

We are using the flag module in Drupal 8 for a community website. The views are joined with the flag table and the flagging table has grown to more than 1M rows, causing database issue while making the website slow to load. Has anyone encountered the database issue with flag module? Any suggestions? Thanks in advance.

Upvotes: 0

Views: 315

Answers (1)

jhnc
jhnc

Reputation: 16752

Did you check the issues for flag?

I see these reports that seem relevant:

  • New index for flagging performance in views relationships - When flags are used as part of a views relationship the resulting query performance slows as more and more flag content is introduced
  • Optimize indices for flagging performance - When you allow a flag to be used by anonymous users [...] and this is used a lot, the performance can slow down extremely [...] I looked into the flagged table and have seen that it contains approx. 1,300,000 rows. After deleting all row with uid = 0 and created timestamp before 30 days ago and afterwards optimizing the table with still approx. 111,000 rows the sum of all DB queries has reduced to 10 milliseconds.

Upvotes: 0

Related Questions