vip-go-mu-plugins icon indicating copy to clipboard operation
vip-go-mu-plugins copied to clipboard

Delete core meta_key INDEX after dbDelta

Open mjangda opened this issue 7 years ago • 3 comments

We added a new meta_key_value INDEX in #445. Unfortunately, dbDelta only adds INDEXes, but doe not delete them. We should probably have a process that deletes the core INDEX after dbDelta since it's no longer necessary.

mjangda avatar Mar 18 '17 20:03 mjangda

@sjinks This might be of interest to you since you're working on CANTINA-852.

rebeccahum avatar Aug 05 '22 20:08 rebeccahum

Related: #2893

sjinks avatar Aug 06 '22 22:08 sjinks

It probably makes sense to create a one-time cron job that will run these queries:

ALTER TABLE wp_postmeta LOCK=NONE, ALGORITHM=NOCOPY, ADD KEY vip_meta_key_value (meta_key(191), meta_value(100));
ALTER TABLE wp_postmeta LOCK=NONE, ALGORITHM=NOCOPY, DROP KEY meta_key, ADD KEY meta_key (meta_key(191), meta_value(100));
ALTER TABLE wp_postmeta LOCK=NONE, ALGORITHM=NOCOPY, DROP KEY vip_meta_key_value;

They will normalize the index without locking the tables.

If there are other keys to drop, we can always use

ALTER TABLE table_name LOCK=NONE, ALGORITHM=NOCOPY, DROP KEY index_name;

sjinks avatar Aug 06 '22 22:08 sjinks

This issue has been marked stale because it has been open for 60 days with no activity. If there is no activity within 7 days, it will be closed.

This is an automation to keep issues manageable and actionable and is not a comment on the quality of this issue nor on the work done so far. Closed issues are still valuable to the project and are available to be searched.

github-actions[bot] avatar Oct 06 '22 00:10 github-actions[bot]

This issue has been marked stale because it has been open for 60 days with no activity. If there is no activity within 7 days, it will be closed.

This is an automation to keep issues manageable and actionable and is not a comment on the quality of this issue nor on the work done so far. Closed issues are still valuable to the project and are available to be searched.

github-actions[bot] avatar Dec 18 '22 00:12 github-actions[bot]