Re: sequential scans and the like operator - Mailing list pgsql-general

From Dave Trombley
Subject Re: sequential scans and the like operator
Date
Msg-id 3C3B4312.5020805@bumba.net
Whole thread Raw
In response to sequential scans and the like operator  ("Roderick A. Anderson" <raanders@tincan.org>)
Responses Re: sequential scans and the like operator  ("Roderick A. Anderson" <raanders@tincan.org>)
Re: sequential scans and the like operator  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Roderick A. Anderson wrote:

>There is a discussion going on on the sql-ledger mailing list concerning
>whether indexes will provide any performance improvements.  The one that
>caught my eye was whether using LIKE in a statement would force a
>sequential scan.
>
    You can always check exaclty what's being done in your queries by
using the EXPLAIN command.  For example, to test your hypothesis:

------------------
test=# create table foo(f text, i int);
CREATE
test=# create index foo_t on foo (f);
CREATE
test=# explain select * from foo where f like '%uiop%';
NOTICE:  QUERY PLAN:

Seq Scan on foo  (cost=0.00..22.50 rows=1 width=36)

EXPLAIN
test=# explain select * from foo where f  = '%uiop%';
NOTICE:  QUERY PLAN:

Index Scan using foo_t on foo  (cost=0.00..17.07 rows=5 width=36)

EXPLAIN
---------------------
-dj trombley
  <dtrom@bumba.net>



pgsql-general by date:

Previous
From: Dave Trombley
Date:
Subject: Re: JDO implementation?
Next
From: "Roderick A. Anderson"
Date:
Subject: Re: sequential scans and the like operator