Skip to main content
Pedro Werneck's user avatar
Pedro Werneck's user avatar
Pedro Werneck's user avatar
Pedro Werneck
  • Member for 12 years, 7 months
  • Last seen more than 1 year ago
comment
Query 'optimizing' state is taking too long
With 'none' the delete operations become too slow. It takes over 25s to delete a 1k chunk. I couldn't even delete enough rows to check if the min() delay becomes noticeable. I'm now experimenting with 'purges', which buffers only the physical deletion and doesn't compromise delete performance, and I'll check If the min() isn't slower after removing a few million rows.
comment
Query 'optimizing' state is taking too long
I'm creating a new RDS instance to repeat the tests with a fresh snapshot. I'll let you know if it works.
awarded
comment
Query 'optimizing' state is taking too long
That seems to be working, the query for min(updated_date) no longer takes several minutes to complete after a long data archiving session, but it still takes an average 3s while initially it would return in a few ms, like the max(updated_date) query. Any idea on what else might be wrong?
awarded
revised
Query 'optimizing' state is taking too long
deleted 4 characters in body
Loading…
comment
Query 'optimizing' state is taking too long
The rows are deleted by primary key. Unfortunately, partitioning is not an option. You say it probably had to finish up all the pending index updates, but if that is the case, subsequent queries should be faster, right? I just noticed even an explain takes a long time to run, so it looks like you're right. Is there any way for me to force the index update immediately after deleting the chunk?
revised
Query 'optimizing' state is taking too long
added 352 characters in body
Loading…
comment
Query 'optimizing' state is taking too long
#1 is an interesting idea, but it took the same amount of time for the min value. Then I noticed it returned almost instantly for the max value. Since I'm deleting rows from the beginning of the index, it looks like something wrong with the index after the deletion. I'd prefer to avoid an optimize table because a copy of a table this size will take hours or days. Unfortunately, #4 is not an option.
awarded
comment
Query 'optimizing' state is taking too long
Thanks for the tip, but that's not the issue.
comment
Query 'optimizing' state is taking too long
@JehadKeriaki yes, InnoDB. Check my updated question.
revised
Query 'optimizing' state is taking too long
added 970 characters in body
Loading…
asked
Loading…
Loading…
awarded
comment
Impact of using UUIDs with an UNIQUE index vs. PK?
@jynus but the first blog post implies any random insertion would have the same impact, PK or not.
revised
Loading…
revised
Loading…