indexes and or clause - Mailing list pgsql-sql

From Clayton Cottingham
Subject indexes and or clause
Date
Msg-id 380BA81F.7FCD7A0A@smartt.com
Whole thread Raw
List pgsql-sql
hello

im having some problems gettin a select to use indexes when passin an or
arguement


SELECT
d.site_item_id,d.header,d.site_code,d.link,d.highest_bid_price,d.currency,
d.close_date,d.bid_quantity
FROM emarqet_kw a,emarqet_kw b, emarqet_kw c, emarqet_1_3 d WHERE
a.primary_id = b.primary_id and
d.primary_id = b.primary_id and (a.keyword='cent' AND
b.keyword='lincoln') limit 20,0 ;

works fine

but as soon as i change it to

SELECT
d.site_item_id,d.header,d.site_code,d.link,d.highest_bid_price,d.currency,
d.close_date,d.bid_quantity
FROM emarqet_kw a,emarqet_kw b, emarqet_kw c, emarqet_1_3 d WHERE
a.primary_id = b.primary_id and
d.primary_id = b.primary_id and (a.keyword='cent' OR
b.keyword='lincoln') limit 20,0 ;

it doesnt handle the index anymore

if i do a select union select type query all is fine

has anyone else experienced this/know what to do!?

thanks a big o bunch

btw this happens on both 6.5 and 6.5.2



pgsql-sql by date:

Previous
From: "Ian L. Atkin"
Date:
Subject: new to postgres!! Perl
Next
From: Herouth Maoz
Date:
Subject: Re: [SQL] insertable views - not copy-able ?