after vacuum verbose analyze, I still get explain select * from isppm where item_upc_cd like '06038301234'; QUERY PLAN ----------------------------------------------------------------------- Seq Scan on isppm (cost=100000000.00..100009684.89 rows=2 width=791) Filter: (item_upc_cd ~~ '06038301234'::text) (2 rows) isp=# explain select * from isppm where item_upc_cd = '06038301234'; QUERY PLAN ------------------------------------------------------------------------ Index Scan using isppm_x0 on isppm (cost=0.00..5.86 rows=2 width=791) Index Cond: (item_upc_cd = '06038301234'::bpchar) (2 rows)
Dave On Thu, 2003-12-18 at 20:38, Christopher Kings-Lynne wrote: > > It appears that the optimizer only uses indexes for = clause? > > The optimizer will used indexes for LIKE clauses, so long as the clause > is a prefix search, eg: > > SELECT * FROM test WHERE a LIKE 'prf%'; > > Chris > > ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]