Re: [PERFORM] subquery and table join, index not use for table

2004-01-16 Thread Stephan Szabo
On Wed, 14 Jan 2004, CoL wrote: [plan1] > -> Seq Scan on menutable b (cost=0.00..13.01 rows=38 width=22) > (actual time=0.02..0.38 rows=38 loops=1) [plan2] > -> Index Scan using menutable_pkey on menutable b > (cost=0.00..29.36 rows=38 width=22) (actual time=0.02..0.12 rows=38 loops=1)

[PERFORM] subquery and table join, index not use for table

2004-01-16 Thread CoL
Hi, I have to following select: set enable_seqscan = on; set enable_indexscan =on; select a.levelno,a.id from (select 1 as levelno,42 as id) a, menutable b where b.site_id='21' and a.id=b.id; menutable: id bigint, site_id bigint Indexes: menutable_pkey primary key btree (site_id, id), The expl