From: hubert depesz lubaczewski <depesz@depesz.com>
To: Rodrigo De León <rdeleonp@gmail.com>
Cc: Fernando Hevia <fhevia@ip-tel.com.ar>
Cc: Kiran <kumar.m.kiran@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Best Fit SQL query statement
Date: Sat, 11 Aug 2007 11:06:44 +0200
Message-ID: <20070811090644.GA5255@depesz.com> (raw)
In-Reply-To: <a55915760708101813u5e5aab6cv198f7c7348083a95@mail.gmail.com>
References: <20070810075949.GA31829@depesz.com>
<00e101c7db86$51b3d8b0$8f01010a@iptel.com.ar>
<20070810225953.GA28341@depesz.com>
<a55915760708101813u5e5aab6cv198f7c7348083a95@mail.gmail.com>
On Fri, Aug 10, 2007 at 08:13:46PM -0500, Rodrigo De León wrote:
> On 8/10/07, hubert depesz lubaczewski <depesz@depesz.com> wrote:
> > unfortunatelly this query will be hard to optimize.
>
> Uh, how about
>
> SELECT MAX(t1)
> FROM t1
> WHERE '9849' LIKE t1 || '%';
it will not help much as the main burden is the where clause, which is
not indexable.
depesz
--
quicksil1er: "postgres is excellent, but like any DB it requires a
highly paid DBA. here's my CV!" :)
http://www.depesz.com/ - blog dla ciebie (i moje CV)
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: depesz@depesz.com, rdeleonp@gmail.com, fhevia@ip-tel.com.ar, kumar.m.kiran@gmail.com
Subject: Re: Best Fit SQL query statement
In-Reply-To: <20070811090644.GA5255@depesz.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