Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I’m guessing the index in question was a partial index defined with a “WHERE column NOT NULL” restriction?

This was a limit of the optimizer previously (IN clauses are broken down into AND/OR groups to prove inferences but only if <= 100 items).

But Postgres 12 includes a patch I wrote so that the optimizer can prove the NOT NULL inference directly from an array operator of any size.



In my case the index is not a partial index, but it is also on PG 9.6.8, in another response[1] I provided more details.

Unfortunately we are stuck with 9.6.x since before my time my company decided to use AWS Aurora, currently there's no easy path to do major version upgrade from 9.6.x and anyway 10.x is the most recent available version :( but any information why is this happening would be appreciated.

[1] https://news.ycombinator.com/item?id=20863418




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: