Re: Updating histogram_bounds after a delete
От | Kevin Grittner |
---|---|
Тема | Re: Updating histogram_bounds after a delete |
Дата | |
Msg-id | 4D81D939020000250003BA22@gw.wicourts.gov обсуждение исходный текст |
Ответ на | Re: Updating histogram_bounds after a delete (Derrick Rice <derrick.rice@gmail.com>) |
Ответы |
Re: Updating histogram_bounds after a delete
Re: Updating histogram_bounds after a delete |
Список | pgsql-performance |
Derrick Rice <derrick.rice@gmail.com> wrote: > Kevin Grittner <Kevin.Grittner@wicourts.gov wrote: > >> there is a feature to probe the end of an index's range in >> situations where data skew was often causing less than optimal >> plans to be chosen. > > Was this introduced in 9.0 or was it earlier? I don't remember when it was added. I took a stab at searching for it, but didn't get it figured out; if nobody who knows off-hand jumps in, I'll try again when I have more time. > It was suggested that I change my SQL from: > > delete from my_table where event_date < now() - interval '12 > hours'; > > to: > > delete from my_table where event_date < now() - interval '12 > hours' and event_date >= (select min(event_date) from my_table); That seems like a reasonable workaround. > Seems like exactly what the feature you mentioned would do, no? I know it helps with inserts off the end of the range; I'm less certain about deletes. I *think* that's covered, but I'd have to dig into the code or do some testing to confirm. -Kevin
В списке pgsql-performance по дате отправления: