pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Samuel J. Sutjiono <ssutjiono@wc-group.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: How does Index Scan get used
Date: Fri, 22 Feb 2002 08:13:02 -0800 (PST)
Message-ID: <20020222081158.U35057-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <018a01c1bbaf$befb84b0$110a010a@headquarters.wcgroup.com>

On Fri, 22 Feb 2002, Samuel J. Sutjiono wrote:

>  I tried an Index Scan but I kept on getting Seq Scan. Do you know why
> ? What do I need to do to get my query to use index scan (I tried to
> turn it on by doing SET ENABLE_indexscan = on; but it didn't work)
>
> create table test (test_col text);
> create index test_index on test (test_col);
> insert into test values ('abc.xyz');
> insert into test values ('abcxyz');
> insert into test values ('abc/xyz');
>
> explain select * from test where test_col like 'abc/%';
>
> NOTICE:  QUERY PLAN:
>
> Seq Scan on test  (cost=0.00..22.50 rows=10 width=12)
>
> Another question:
> Does Regex (~*) or like use table scan ?

It may, but IIRC only if you're running in 'C' locale (the
rule being used to make it indexable doesn't necessarily
work in other locales).





view thread (7+ messages)  latest in thread

Message-ID: <20020222081158.U35057-100000@megazone23.bigpanda.com>
Permalink:  ../20020222081158.U35057-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20020222081158.U35057-100000@megazone23.bigpanda.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sszabo@megazone23.bigpanda.com, ssutjiono@wc-group.com
  Subject: Re: How does Index Scan get used
  In-Reply-To: <20020222081158.U35057-100000@megazone23.bigpanda.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox