Bad estimates

2017-11-22 Thread Artur Zając
Hi, We have table created like this: CREATE TABLE xyz AS SELECT generate_series(1,1000,1) AS gs; Now: db=# explain analyze select * from xyz where gs&1=1; QUERY PLAN --

RE: Bad estimates

2017-11-22 Thread Artur Zając
TATISTICS from PostgreSQL 10). Sometimes It's not possibile to divide one column into many , and as I know, it is not worth creating an index if there are few different values in the table. Artur Zajac -Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: Wednesday, N

IS NOT DISTINCT FROM statement

2019-03-08 Thread Artur Zając
I have some query: EXPLAIN ANALYZE select id from sometable where fkey IS NOT DISTINCT FROM 21580; QUERY PLAN ---

RE: IS NOT DISTINCT FROM statement

2019-03-08 Thread Artur Zając
> In short, probably possible, but why not just write an equality clause, if > you know NULLs are not possible? In fact I construct query like this (usually in pl/pgsql). SELECT column FROM table WHERE column1 IS NOT DISTINCT FROM $1 AND column2 IS NOT DISTINCT FROM $2; "IS NOT DISTINCT FROM