pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: scott.marlowe <scott.marlowe@ihs.com>
Cc: Neil Conway <neilc@samurai.com>
Cc: Pailloncy Jean-Gérard <pailloncy@ifrance.com>
Cc: PostgreSQL Performance <pgsql-performance@postgresql.org>
Subject: Re: slow plan for min/max
Date: Mon, 08 Sep 2003 17:26:16 -0400
Message-ID: <3303.1063056376@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.33.0309081434150.11709-100000@css120.ihs.com>
References: <Pine.LNX.4.33.0309081434150.11709-100000@css120.ihs.com>

"scott.marlowe" <scott.marlowe@ihs.com> writes:
> On Mon, 8 Sep 2003, Neil Conway wrote:
>> As was pointed out in a thread a couple days ago, MIN/MAX() optimization
>> has absolutely nothing to do with MVCC. It does, however, make
>> optimizing COUNT() more difficult.

> Not exactly.  While max(id) is easily optimized by query replacement, 
> more complex aggregates will still have perfomance issues that would not 
> be present in a row locking database.  i.e. max((field1/field2)*field3) is 
> still going to cost more to process, isn't it?

Er, what makes you think that would be cheap in any database?

Postgres would actually have an advantage given its support for
expressional indexes (nee functional indexes).  If we had an optimizer
transform to convert MAX() into an index scan, I would expect it to be
able to match up max((field1/field2)*field3) with an index on
((field1/field2)*field3).

			regards, tom lane



view thread (20+ messages)  latest in thread

Message-ID: <3303.1063056376@sss.pgh.pa.us>
Permalink:  ../3303.1063056376@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3303.1063056376@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-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, scott.marlowe@ihs.com, neilc@samurai.com, pailloncy@ifrance.com
  Subject: Re: slow plan for min/max
  In-Reply-To: <3303.1063056376@sss.pgh.pa.us>
  References: <Pine.LNX.4.33.0309081434150.11709-100000@css120.ihs.com> <3303.1063056376@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