Optimisation deficiency: currval('seq')-->seq scan, constant-->index scan

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Optimisation deficiency: currval('seq')-->seq scan, constant-->index scan
Date: 2000-08-20 11:38:08
Message-ID: 399FC320.AFA7A99B@tm.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

It seems that optimiser is unaware that currval('seq') can be treated as
a constant within
an expression and thus produces suboptimal plans for WHERE clauses that
use currval
thus using a seq scan instead of index scan.

Is it possible (planned) to mark functions as returning a constant when
given a constant
argument and start using it _as a constant_ (pre-evaluated) in queries

The current behaviour is not very intuitive.

------------
Hannu

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2000-08-20 11:56:53 RE: [PATCHES] Patch - SSL back to working
Previous Message Wim Ceulemans 2000-08-20 11:19:35 Re: Bug tracking (was Re: +/- Inf for float8's)