optimizer question

From: Michael Meskes <meskes(at)postgresql(dot)org>
To: PostgreSQL Hacker <pgsql-hackers(at)postgresql(dot)org>
Subject: optimizer question
Date: 2002-10-18 17:02:31
Message-ID: 20021018170231.GA2974@feivel.fam-meskes.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I was just approached with an optimizer question I cannot answer. Does
our optimizer know how expensive different comparisons are? That is can
it do something like:

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.

Okay, we may argue whether a regexp is more expensive than a function,
but you get the idea. Are we able to get that logic in where clauses
where no index is defined? I just tried a query that given the order in
the where clause either takes a few seconds or forever. Well, I killed
the query after quite some time.

Michael
--
Michael Meskes
Michael(at)Fam-Meskes(dot)De
Go SF 49ers! Go Rhein Fire!
Use Debian GNU/Linux! Use PostgreSQL!

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-10-18 18:43:47 Re: pg_encoding doesn't reject invalid input
Previous Message Bruce Momjian 2002-10-18 17:01:29 memcpy testing