Re: Endgame for all those SELECT FOR UPDATE changes: fix plan node order - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Endgame for all those SELECT FOR UPDATE changes: fix plan node order
Date
Msg-id 20091026125351.GA8812@alvh.no-ip.org
Whole thread Raw
In response to Re: Endgame for all those SELECT FOR UPDATE changes: fix plan node order  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Endgame for all those SELECT FOR UPDATE changes: fix plan node order
List pgsql-hackers
Tom Lane escribió:
> Robert Haas <robertmhaas@gmail.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


pgsql-hackers by date:

Previous
From: Sergey Konoplev
Date:
Subject: 8.4.1 strange GiST (btree_gist?) messages + index row size error (possible BUG, test case + test data)
Next
From: Simon Riggs
Date:
Subject: Re: License clarification: BSD vs MIT