Search Postgresql Archives

Re: Index no longer being used, destroying and recreating it restores use.

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

 



On Tue, Jun 16, 2020 at 11:49:15AM +0200, Koen De Groote wrote:
> Alright, I've done that, and that seems to be a very good result: https://
> explain.depesz.com/s/xIph
> 
> The method I ended up using:
> 
> create or replace function still_needs_backup(shouldbebackedup bool,
> backupperformed bool)
> returns BOOLEAN as $$
>    select $1 AND NOT $2;
> $$
> language sql immutable;
> 
> And the index is as suggested.
> 
> It seems the amount of rows we end up with has improved.
> 
> Thank you for your help. I wasn't aware functions could interact with indexes
> in such a manner.

This blog entry explains how statistics on expression/function indexes
can help:

	https://momjian.us/main/blogs/pgblog/2017.html#February_20_2017

-- 
  Bruce Momjian  <bruce@xxxxxxxxxx>        https://momjian.us
  EnterpriseDB                             https://enterprisedb.com

  The usefulness of a cup is in its emptiness, Bruce Lee






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux