Use index to estimate expression selectivity - Mailing list pgsql-hackers

From Bono Stebler
Subject Use index to estimate expression selectivity
Date
Msg-id db61d596-41bc-4d5b-a4a2-30f7c51a5854@gmail.com
Whole thread Raw
Responses Re: Use index to estimate expression selectivity
List pgsql-hackers
Dear hackers,

After discussing the issue on irc, it looks like it could be possible 
for the planner to use a partial index matching an expression exactly to 
estimate its selectivity.

Here is a simplified version (thanks ysch) of the issue I am facing:

https://dbfiddle.uk/flPq8-pj

I have tried using CREATE STATISTICS as well but haven't found a way to 
improve the planner estimation for that query.

I have worked around the problem for my specific use case but that 
behavior is counter-intuitive, is there any interest in improving it?

Thank you!




pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: WaitEventSet resource leakage
Next
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: Random pg_upgrade test failure on drongo