pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <maillist@candle.pha.pa.us>
Cc: Howie <caffeine@toodarkpark.org>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] optimizer woes ?
Date: Tue, 15 Jun 1999 15:55:58 -0400
Message-ID: <23416.929476558@sss.pgh.pa.us> (raw)
In-Reply-To: <199906151714.NAA11734@candle.pha.pa.us>

>> shouldn't the optimizer convert lower('anick') to lowercase first, then
>> use that value in searching the logins_nick_idx index ?

The system only knows how to use qualifications like "var rel constant"
as index-scan restrictions.  "var rel func(constant)" is not of that
form ... but it could be if there were a preprocessing step that
recognized "func(constant)" as a constant subexpression and replaced it
by its result.

Right now, we don't have any such step.  I've been thinking about it for
6.6 though.

Bruce Momjian <maillist@candle.pha.pa.us> writes:
> We have on our TODO list:
> 	* Use index with constants on functions

The TODO entry is insufficiently ambitious: it should read "implement
a general-purpose constant-subexpression-reduction step".  (Actually,
I think that TODO entry might refer to something completely different
... wasn't the complaint that you couldn't make an index on
"date_part('date', field)"? )

			regards, tom lane



view thread (4+ messages)  latest in thread

Message-ID: <23416.929476558@sss.pgh.pa.us>
Permalink:  ../23416.929476558@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23416.929476558@sss.pgh.pa.us

 · 

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-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, maillist@candle.pha.pa.us, caffeine@toodarkpark.org
  Subject: Re: [SQL] optimizer woes ?
  In-Reply-To: <23416.929476558@sss.pgh.pa.us>
  References: <199906151714.NAA11734@candle.pha.pa.us> <23416.929476558@sss.pgh.pa.us>

* 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