pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: Jouneau Luc <Luc.Jouneau@diamant.jouy.inra.fr>
Cc: pgsql-admin@postgresql.org
Subject: Re: Seq scan with a like operator
Date: Fri, 23 Jul 2004 18:00:07 +0200
Message-ID: <200407231800.07825.peter_e@gmx.net> (raw)
In-Reply-To: <011e01c470c9$26b637f0$4703668a@pc502jlo>
References: <006d01c470b3$aa0381f0$4703668a@pc502jlo>
	<200407231654.33879.peter_e@gmx.net>
	<011e01c470c9$26b637f0$4703668a@pc502jlo>

Am Freitag, 23. Juli 2004 17:24 schrieb Jouneau Luc:
> I didn't notice it when I red the doc, but if I create the index as
> specified then it is the query with equal operator which use a seq scan.
> Do I have to create 2 indexes on the same column (with different datatype)
> in order to support different kind of queries ?

Yes.

> Well, It seems quite strange to me :
> Suppose you have an user interface in which user can parameter his query on
> 4 varchar fields (independantly, i.e field 4 does not need to have field
> 1,2 or 3 filled), and you allow to use generic character such as '*' or '?'
> (which will be translated into '%' and '_'). User can also fill in exact
> values.

I think that kind of interface would use the LIKE operator no matter whether 
the user entered wildcards or not.

> It would also mean that support both exact generic queries double the
> indexing task on update/insert/delete.

Well, if you want to optimize lots of different queries, the system needs to 
provide lots of different support.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/



view thread (4+ messages)

Message-ID: <200407231800.07825.peter_e@gmx.net>
Permalink:  ../200407231800.07825.peter_e@gmx.net/
Also on:    postgresql.org/message-id/200407231800.07825.peter_e@gmx.net

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: peter_e@gmx.net, Luc.Jouneau@diamant.jouy.inra.fr
  Subject: Re: Seq scan with a like operator
  In-Reply-To: <200407231800.07825.peter_e@gmx.net>
  References: <006d01c470b3$aa0381f0$4703668a@pc502jlo> <200407231654.33879.peter_e@gmx.net> <011e01c470c9$26b637f0$4703668a@pc502jlo> <200407231800.07825.peter_e@gmx.net>

* 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