These are chat archives for ManageIQ/manageiq/performance
ALTER TABLE measurement DETACH PARTITION measurement_y2006m02;
metrics_xxsequence screwed things up?
(0..23).each do |n| s = subtable_name("metrics", n) create_metrics_table s add_metrics_indexes s add_table_inheritance s, "metrics", :conditions => ["capture_interval_name = ? AND EXTRACT(HOUR FROM timestamp) = ?", "realtime", n] end
(I'm talking about you @NickLaMuro ;) )
Is still playing catchup
I see "set constraint on"
but is it that simple?
Read into that setting a little and it's one of those three-way values... on/off/partition and partition is the default
explain analyze DELETE FROM "metrics" WHERE "metrics"."ctid" IN ( SELECT "metrics_00"."ctid" FROM "metrics_00" WHERE ("metrics_00"."timestamp" <= '2018-02-01 19:56:37.519979') and capture_interval_name = 'realtime' LIMIT 100 ) and capture_interval_name = 'realtime';
ok, this is quick:
explain analyze DELETE FROM "metrics_00" WHERE "id" IN ( SELECT "metrics"."id" FROM "metrics" WHERE ("metrics"."timestamp" <= '2018-02-01 19:56:37.519979') and capture_interval_name = 'realtime' and date_part('hour'::text, "timestamp") = '0' LIMIT 100 );
Had to specify capture interval AND date_part (so it hit the constraint.
Note how it has
select from metrics - it only selects from 1 table - so the constraint took effect
tools/purge_metrics.rbenhancement or something
purge_metrics.rb, or do you think we'll have a chance with ManageIQ/manageiq#17017 ?
2cents: @kbrock The more and more I think about it, I think that would be the best route to go as well, possibly make it a opt-in toggle in
purge_metrics.rb for those that are still using it don't get blind-sided by the change.
That, or you could consider making the changes to 17017 an opt-in feature toggle/experimental feature. Basically, I feel that we haven't done our due-diligence with testing the truncation strategy, even though I think it definitely makes sense going forward. But with this being about deleting data, I tend to lean towards being as skeptical about changes as possible.