Re: optimizer question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Meskes <meskes(at)postgresql(dot)org>
Cc: PostgreSQL Hacker <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: optimizer question
Date: 2002-10-18 18:48:58
Message-ID: 20040.1034966938@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Meskes <meskes(at)postgresql(dot)org> writes:
> I was just approached with an optimizer question I cannot answer. Does
> our optimizer know how expensive different comparisons are?

It does not, because there's noplace it could look to find the info.

> If there are different comparisons in a where clause check the ints
> first, then the strings, then everything with regexp, or like clauses
> etc. and finally function calls at last, because in most cases a
> function call is the most expensive one.

Unfortunately, these all look like function calls to the optimizer.

I have played with the notion of forcing subquery-based WHERE clauses
to the end of the list, but that's about all that we could easily manage
without great leaps of assumptions...

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-10-18 18:51:12 Re: ECPG and bison
Previous Message Tom Lane 2002-10-18 18:43:47 Re: pg_encoding doesn't reject invalid input