Re: Endgame for all those SELECT FOR UPDATE changes: fix plan node order

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgreSQL(dot)org" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Endgame for all those SELECT FOR UPDATE changes: fix plan node order
Date: 2009-10-26 12:53:52
Message-ID: 20091026125351.GA8812@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane escribió:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:

> > This seems like it could potentially introduce a performance
> > regression, but the current behavior is so bizarre that it seems like
> > we should still change it.
>
> Yeah, it could definitely run slower than the existing code --- in
> particular the combination of all three (FOR UPDATE ORDER BY LIMIT)
> would tend to become a seqscan-and-sort rather than possibly just
> reading one end of an index. However, I quote the old aphorism that
> it can be made indefinitely fast if it doesn't have to give the right
> answer. The reason the current behavior is fast is it's giving the
> wrong answer :-(

So this probably merits a warning in the release notes for people to
check that their queries continue to run with the performance they
expect.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-10-26 13:04:11 Re: Parsing config files in a directory
Previous Message Sergey Konoplev 2009-10-26 12:49:02 8.4.1 strange GiST (btree_gist?) messages + index row size error (possible BUG, test case + test data)