Index usage for BYTEA column in OR/IN clause

From: David Garamond <lists(at)zara(dot)6(dot)isreserved(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Index usage for BYTEA column in OR/IN clause
Date: 2004-03-27 14:52:45
Message-ID: 4065953D.2050708@zara.6.isreserved.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Is it true that the planner currently doesn't utilize index for BYTEA
column in OR or IN clause?

-- b is an indexed BYTEA column

explain select * from t where b='foo'; -- index scan
explain select * from t where b like 'f%'; -- index

explain select * from t where b='foo' or b='bar'; -- seq scan
explain select * from t where b='foo' or b like 'b%'; -- seq
explain select * from t where b like 'f%' or b like 'b%'; -- seq
explain select * from t where b in ('foo','bar'); -- seq

Currently I'm setting enable_seqscan to off for these...

--
dave

Responses

Browse pgsql-general by date

  From Date Subject
Next Message weiping he 2004-03-27 15:04:20 Re: Native Win32 port - PLEASE!
Previous Message Richard Welty 2004-03-27 14:30:44 Re: Physical Database Configuration