Re: Updating histogram_bounds after a delete

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Derrick Rice <derrick.rice@xxxxxxxxx> wrote:
> Kevin Grittner <Kevin.Grittner@xxxxxxxxxxxx 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

-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux