[PERFORM] Planner improvement suggestion

2005-08-28 Thread Ilia Kantor
I have a query:   SELECT oh.idFROM objects_hier ohwhereoh.id < 2000 (!)andoh.id in (  SELECT id as id FROM objects_access oa  WHERE  oa.master IN (1,2,10001)  AND  oa.id < 2000 (!) )   The sense of the query is simple: I choose ids from objects_hier where access has

[PERFORM] Bitmap scan when it is not needed

2005-08-28 Thread Ilia Kantor
explain analyze select * from objects_hier where tg && array[0] and id <1;   Bitmap Heap Scan on objects_hier  (cost=4.79..8.80 rows=1 width=337) (actual time=0.110..0.110 rows=0 loops=1)    Recheck Cond: ((tg && '{0}'::integer[]) AND (id < 1))    ->  BitmapAnd  (cost=4.79..4.79

[PERFORM] intarray is broken ? (8.1b1)

2005-08-28 Thread Ilia Kantor
I tried to use intarray on 8.1 . It seems to give same estimates for anything I ask:   explain analyze select * from objects_hier where tg && array[10001] explain analyze select * from objects_hier where tg && array[0] explain analyze select * from objects_hier where tg @ array[10001]

[PERFORM] Index type

2004-07-25 Thread Ilia Kantor
Hello, I have a request like SELECT ... WHERE x<=A<=y AND t<=B<=u AND z<=C<=w AND .. 5 columns are in BETWEEN clauses. What is the best index I could use? If I create btree index on all columns (A,B,C..), here is what explain analyze gives me: