From: Nick Fankhauser <nickf@ontko.com>
To: Frank Bax <fbax@sympatico.ca>
Cc: Guru\(External\) <guru@indvalley.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Resources
Date: Fri, 11 Jan 2002 11:13:58 -0500
Message-ID: <NEBBLAAHGLEEPCGOBHDGMEOIECAA.nickf@ontko.com> (raw)
In-Reply-To: <3.0.6.32.20020111110937.02289430@pop6.sympatico.ca>
> I don't beleive indexes will improve SELECT using LIKE.
I wondered about that too, so I did a test using a database I'm working
with. The results indicate that it helps substantially- here is my terminal
log file:
staging=#
staging=#
staging=# explain select count(*) from actor where actor_full_name like
'A%';
NOTICE: QUERY PLAN:
Aggregate (cost=1067.72..1067.72 rows=1 width=0)
-> Seq Scan on actor (cost=0.00..1066.29 rows=572 width=0)
EXPLAIN
staging=# create index test on actor(actor_full_name);
CREATE
staging=# explain select count(*) from actor where actor_full_name like
'A%';
NOTICE: QUERY PLAN:
Aggregate (cost=577.46..577.46 rows=1 width=0)
-> Index Scan using test on actor (cost=0.00..576.03 rows=572 width=0)
EXPLAIN
staging=#
-Nick
--------------------------------------------------------------------------
Nick Fankhauser nickf@ontko.com Phone 1.765.935.4283 Fax 1.765.962.9788
Ray Ontko & Co. Software Consulting Services http://www.ontko.com/
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: nickf@ontko.com, fbax@sympatico.ca, guru@indvalley.com
Subject: Re: Resources
In-Reply-To: <NEBBLAAHGLEEPCGOBHDGMEOIECAA.nickf@ontko.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