[14.0][FIX] attachment_unindex_content: Add WHERE clause to UPDATE query
Adding the WHERE clause, the query will only update rows where index_content is not NULL, reducing the number of unnecessary updates. If most values are already NULL, the speed execution is significantly improved; less than an hour for my test-case with an ir_attachment table of 300 GB. I used a SQL pre-script in order to batch the updates (batches of 10k records) before installing this specific attachment_unindex_content module and it really improved the global installation time needed.
Hi @luisg123v, @moylop260, @ebirbe, some modules you are maintaining are being modified, check this out!
SGTM
Would be nice if you have any performance comparison to include.
Let's give a chance to @luisg123v or @moylop260 to review.
SGTM
Would be nice if you have any performance comparison to include.
Let's give a chance to @luisg123v or @moylop260 to review.
Thanks @ebirbe, I updated my PR description for more clarity
Just out of interest, what would ALTER TABLE DROP COLUMN ..., ALTER TABLE ADD COLUMN do for performance.
Just out of interest, what would ALTER TABLE DROP COLUMN ..., ALTER TABLE ADD COLUMN do for performance.
It is radically faster indeed. But AFAIK any constraints would be lost and need to be re-added manually and any eventual column-level permissions would need to be reapplied. But in a "normal" use-case it should work as there are none of those linked to the index_content column