From: | Dave Cramer <pg(at)fastcrypt(dot)com> |
---|---|
To: | Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au> |
Cc: | pgsql-performance(at)postgresql(dot)org |
Subject: | Re: is it possible to get the optimizer to use indexes |
Date: | 2003-12-19 03:08:37 |
Message-ID: | 1071803317.1629.16.camel@localhost.localdomain |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
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
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Christopher Browne | 2003-12-19 03:22:38 | Re: is it possible to get the optimizer to use indexes with a like clause |
Previous Message | Christopher Kings-Lynne | 2003-12-19 01:38:50 | Re: is it possible to get the optimizer to use indexes |