pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedINDEX and LIKE
2+ messages / 2 participants
[nested] [flat]
* INDEX and LIKE
@ 2004-11-29 12:19 T E Schmitz <mailreg@numerixtechnology.de>
2004-11-29 13:45 ` Re: INDEX and LIKE Olivier Hubaut <olivier@scmbb.ulb.ac.be>
0 siblings, 1 reply; 2+ messages in thread
From: T E Schmitz @ 2004-11-29 12:19 UTC (permalink / raw)
To: pgsql-sql
Hello,
I need to be able to perform wildcard searches on a VARCHAR(100) column
of the form
SELECT * FROM item WHERE serial_no LIKE '%12345678%'
Would an index on serial_no do anything at all for this search?
--
Regards/Gruß,
Tarlika Elisabeth Schmitz
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: INDEX and LIKE
2004-11-29 12:19 INDEX and LIKE T E Schmitz <mailreg@numerixtechnology.de>
@ 2004-11-29 13:45 ` Olivier Hubaut <olivier@scmbb.ulb.ac.be>
0 siblings, 0 replies; 2+ messages in thread
From: Olivier Hubaut @ 2004-11-29 13:45 UTC (permalink / raw)
To: pgsql-sql
On Mon, 29 Nov 2004 12:19:12 +0000, T E Schmitz
<mailreg@numerixtechnology.de> wrote:
> Hello,
>
> I need to be able to perform wildcard searches on a VARCHAR(100) column
> of the form
>
> SELECT * FROM item WHERE serial_no LIKE '%12345678%'
>
> Would an index on serial_no do anything at all for this search?
>
No, It wouldn't. If you use "%" for the beginning of you search pattern, a
seqential search is performed, ignoring the index wich use the beginning
of the string in order to create it's B-tree.
--
Downloading signature ... 99%
*CRC FAILED*
signature aborted
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2004-11-29 13:45 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-11-29 12:19 INDEX and LIKE T E Schmitz <mailreg@numerixtechnology.de>
2004-11-29 13:45 ` Olivier Hubaut <olivier@scmbb.ulb.ac.be>
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