Re: Optimization of range queries

2018-04-10 Thread Konstantin Knizhnik
On 09.04.2018 20:05, Teodor Sigaev wrote: Hi! 12 years ago I proposed patch to which could "union" OR clauses into one range clause if it's possible. In that time pgsql could not use IS NULL as index clause, so patch doesn't support that

Re: Optimization of range queries

2018-04-09 Thread Teodor Sigaev
Hi! 12 years ago I proposed patch to which could "union" OR clauses into one range clause if it's possible. In that time pgsql could not use IS NULL as index clause, so patch doesn't support that https://www.postgresql.org/message-id/flat/45742C51.9020602%40sigaev.ru option number 4), all

Optimization of range queries

2018-04-09 Thread Konstantin Knizhnik
Hi hackers, Postgres optimizer is not able to build efficient execution plan for the following query: explain select * fromĀ  people_raw where not ("ID"<2068113880 AND "INN" is not null) and "ID"<=2068629726 AND "INN" is not null; QUERY PLAN