Re: formatting of SQL sent by PHP to postgres

From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: formatting of SQL sent by PHP to postgres
Date: 2003-10-30 22:18:45
Message-ID: 871xsucqt6.fsf@stark.dyndns.tv
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


"scott.marlowe" <scott(dot)marlowe(at)ihs(dot)com> writes:

> Postgresql's MVCC design makes it hard to use indexes for aggregate
> functions. So, if you use something like max(id), postgresql literally
> has to seq scan the table to find the max(id). MVCC allows postgresql to
> handle massive parallel load. It causes some minor performance issues
> like that that are hard to code around cleanly.

That postgres doesn't use indexes for max/min is really not related to MVCC.
It would be a lot of work to do so and involve changes to lots of places and
it just hasn't been done yet. But it can be done and would be just as hard
without MVCC.

You're thinking of caching aggregate results for things like count(). That's
where supporting transactions makes it hard. But that's really unrelated to
min/max and indexes.

--
greg

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Claudio Natoli 2003-10-30 23:47:58 Re: Info Required!!
Previous Message Robert Treat 2003-10-30 22:00:33 Re: formatting of SQL sent by PHP to postgres