From:
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To:
Manfred Koizar <mkoi-pg(at)aon(dot)at>
Cc:
Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>,"Jonah H(dot) Harris" <jharris(at)tvi(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject:
Re: Much Ado About COUNT(*)
Date:
2005-01-16 20:22:11
Message-ID:
19382.1105906931@sss.pgh.pa.us (view raw or flat )
Thread:
2005-01-11 20:15:41 from "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
2005-01-12 08:23:57 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2005-01-12 08:53:43 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-01-12 10:38:55 from Reinhard Max <max(at)suse(dot)de>
2005-01-12 10:17:52 from Reinhard Max <max(at)suse(dot)de>
2005-01-12 15:29:23 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2005-01-12 16:29:34 from Reinhard Max <max(at)suse(dot)de>
2005-01-12 17:20:14 from Reinhard Max <max(at)suse(dot)de>
2005-01-12 17:42:56 from "Jonah H(dot) Harris" <jharris(at)tvi(dot)edu>
2005-01-12 18:24:26 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-01-12 18:55:29 from "Jonah H(dot) Harris" <jharris(at)tvi(dot)edu>
2005-01-12 19:23:44 from Greg Stark <gsstark(at)mit(dot)edu>
2005-01-12 19:36:15 from "Jonah H(dot) Harris" <jharris(at)tvi(dot)edu>
2005-01-12 20:08:37 from Greg Stark <gsstark(at)mit(dot)edu>
2005-01-12 20:41:38 from Jeff Davis <jdavis-pgsql(at)empires(dot)org>
2005-01-12 21:43:46 from Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
2005-01-13 02:45:09 from Jeff Davis <jdavis-pgsql(at)empires(dot)org>
2005-01-13 03:19:18 from Greg Stark <gsstark(at)mit(dot)edu>
2005-01-13 03:50:57 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-01-12 21:42:06 from "Marek Mosiewicz" <marekmosiewicz(at)poczta(dot)onet(dot)pl>
2005-01-12 19:41:56 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-01-12 19:52:53 from "Jonah H(dot) Harris" <jharris(at)tvi(dot)edu>
2005-01-12 20:09:04 from Rod Taylor <pg(at)rbt(dot)ca>
2005-01-12 20:59:07 from "Jonah H(dot) Harris" <jharris(at)tvi(dot)edu>
2005-01-12 21:45:51 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2005-01-12 21:58:14 from "Jonah H(dot) Harris" <jharris(at)tvi(dot)edu>
2005-01-12 22:03:58 from Rod Taylor <pg(at)rbt(dot)ca>
2005-01-12 20:14:51 from "Andrew Dunstan" <andrew(at)dunslane(dot)net>
2005-01-12 20:42:58 from "Jonah H(dot) Harris" <jharris(at)tvi(dot)edu>
2005-01-12 21:02:23 from Jon Jensen <jon(at)endpoint(dot)com>
2005-01-12 21:06:32 from "Jonah H(dot) Harris" <jharris(at)tvi(dot)edu>
2005-01-12 21:17:57 from Jeff Davis <jdavis-pgsql(at)empires(dot)org>
2005-01-12 21:36:55 from "Jonah H(dot) Harris" <jharris(at)tvi(dot)edu>
2005-01-12 21:20:43 from Bruno Wolff III <bruno(at)wolff(dot)to>
2005-01-12 21:56:25 from Bruno Wolff III <bruno(at)wolff(dot)to>
2005-01-12 21:48:33 from "Jonah H(dot) Harris" <jharris(at)tvi(dot)edu>
2005-01-18 20:45:50 from Sailesh Krishnamurthy <sailesh(at)cs(dot)berkeley(dot)edu>
2005-01-18 22:10:48 from Jeff Davis <jdavis-pgsql(at)empires(dot)org>
2005-01-18 22:29:16 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-01-18 22:42:32 from Sailesh Krishnamurthy <sailesh(at)cs(dot)berkeley(dot)edu>
2005-01-18 23:01:01 from Jeff Davis <jdavis-pgsql(at)empires(dot)org>
2005-01-19 05:09:53 from Christopher Browne <cbbrowne(at)acm(dot)org>
2005-01-12 20:59:51 from Jeff Davis <jdavis-pgsql(at)empires(dot)org>
2005-01-13 10:12:49 from Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
2005-01-13 04:15:58 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2005-01-13 04:54:52 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-01-13 04:57:56 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2005-01-13 05:06:38 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-01-13 05:25:09 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2005-01-13 05:39:56 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-01-13 14:04:46 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2005-01-13 15:29:16 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-01-13 18:22:42 from "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>
2005-01-13 19:20:36 from "Jonah H(dot) Harris" <jharris(at)tvi(dot)edu>
2005-01-16 19:49:45 from Manfred Koizar <mkoi-pg(at)aon(dot)at>
2005-01-16 20:11:37 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-01-16 20:22:11 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-01-17 00:53:01 from "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
2005-01-17 01:01:36 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-01-17 01:24:57 from Jochem van Dieten <jochemd(at)gmail(dot)com>
2005-01-17 01:28:07 from "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
2005-01-17 01:32:02 from "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
2005-01-17 01:34:58 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-01-22 21:19:16 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2005-01-16 20:38:31 from Jochem van Dieten <jochemd(at)gmail(dot)com>
2005-01-22 20:06:33 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2005-01-23 08:36:10 from Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
2005-01-23 21:36:18 from "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
2005-01-23 23:41:55 from Mark Kirkwood <markir(at)coretech(dot)co(dot)nz>
2005-01-24 15:28:09 from "Jonah H(dot) Harris" <jharris(at)tvi(dot)edu>
2005-01-25 07:33:57 from Manfred Koizar <mkoi-pg(at)aon(dot)at>
2005-01-25 12:03:28 from Christopher Browne <cbbrowne(at)acm(dot)org>
2005-01-12 18:36:52 from Reinhard Max <max(at)suse(dot)de>
2005-01-12 19:11:32 from Reinhard Max <max(at)suse(dot)de>
2005-01-12 19:59:42 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-01-12 20:10:16 from Reinhard Max <max(at)suse(dot)de>
2005-01-12 21:38:44 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-01-12 19:28:39 from Kurt Roeckx <Q(at)ping(dot)be>
2005-01-12 19:34:40 from Reinhard Max <max(at)suse(dot)de>
Lists:
pgsql-announce pgsql-hackers pgsql-patches
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> Manfred Koizar <mkoi-pg(at)aon(dot)at> writes:
>> Last time we discussed this, didn't we come to the conclusion, that
>> resetting status bits is not a good idea because of possible race
>> conditions?
> There's no race condition,
Actually, wait a minute --- you have a point. Consider a tuple whose
inserting transaction (A) has just dropped below GlobalXmin.
Transaction B is doing an index scan, so it's going to do something like
* Visit index entry, observe that it is in "uncertain" state.
* Visit heap tuple, observe that A has committed and is < GlobalXmin,
and there is no deleter.
* Return to index entry and mark it "visible to all".
Now suppose transaction C decides to delete the tuple. It will
* Insert itself as the XMAX of the heap tuple.
* Visit index entry, set state to "uncertain" if not already that way.
C could do this between steps 2 and 3 of B, in which case the index
entry ends up improperly marked "visible to all" while in fact a
deletion is pending. Ugh. We'd need some kind of interlock to prevent
this from happening, and it's not clear what. Might be tricky to create
such an interlock without introducing either deadlock or a big
performance penalty.
regards, tom lane
In response to
Responses
pgsql-announce by date
Next :From: Jochem van DietenDate: 2005-01-16 20:38:31
Subject : Re: Much Ado About COUNT(*)
Previous :From : Tom LaneDate : 2005-01-16 20:11:37
Subject : Re: Much Ado About COUNT(*)
pgsql-hackers by date
Next :From: Jochem van DietenDate: 2005-01-16 20:38:31
Subject : Re: Much Ado About COUNT(*)
Previous :From : Tom LaneDate : 2005-01-16 20:11:37
Subject : Re: Much Ado About COUNT(*)
pgsql-patches by date
Next :From: Jochem van DietenDate: 2005-01-16 20:38:31
Subject : Re: Much Ado About COUNT(*)
Previous :From : Bruce MomjianDate : 2005-01-16 20:13:26
Subject : Re: Increased error verbosity when querying row-returning