From:
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To:
Jochem van Dieten <jochemd(at)gmail(dot)com>
Cc:
Gregory Maxwell <gmaxwell(at)gmail(dot)com>, Greg Stark <gsstark(at)mit(dot)edu>,
Simon Riggs <simon(at)2ndquadrant(dot)com>,
Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>,
pgsql-hackers(at)postgresql(dot)org
Subject:
Re: Reducing relation locking overhead
Date:
2005-12-02 23:32:57
Message-ID:
8855.1133566377@sss.pgh.pa.us (view raw or flat )
Thread:
2005-12-02 02:37:47 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-12-02 02:45:02 from Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
2005-12-02 03:03:33 from Stephen Frost <sfrost(at)snowman(dot)net>
2005-12-02 06:44:08 from Greg Stark <gsstark(at)mit(dot)edu>
2005-12-02 07:14:37 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-12-02 14:53:27 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2005-12-02 20:25:58 from Greg Stark <gsstark(at)mit(dot)edu>
2005-12-02 21:01:39 from Gregory Maxwell <gmaxwell(at)gmail(dot)com>
2005-12-02 22:04:23 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2005-12-02 22:34:57 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2005-12-02 22:45:10 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-12-03 09:10:54 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2005-12-03 15:15:25 from Greg Stark <gsstark(at)mit(dot)edu>
2005-12-03 15:47:26 from Kevin Brown <kevin(at)sysexperts(dot)com>
2005-12-03 16:57:49 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-12-03 17:09:53 from Kevin Brown <kevin(at)sysexperts(dot)com>
2005-12-03 17:53:44 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-12-04 03:38:28 from "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
2005-12-04 03:51:12 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-12-04 17:13:28 from Kevin Brown <kevin(at)sysexperts(dot)com>
2005-12-04 18:32:56 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-12-04 20:15:37 from Kevin Brown <kevin(at)sysexperts(dot)com>
2005-12-05 03:07:38 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-12-05 06:40:55 from Kevin Brown <kevin(at)sysexperts(dot)com>
2005-12-05 13:38:17 from mark(at)mark(dot)mielke(dot)cc
2005-12-05 14:47:43 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-12-05 15:08:55 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2005-12-05 16:28:43 from Kevin Brown <kevin(at)sysexperts(dot)com>
2005-12-05 01:27:03 from Greg Stark <gsstark(at)mit(dot)edu>
2005-12-03 16:29:43 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-12-08 06:16:42 from "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
2005-12-08 06:57:42 from Hannu Krosing <hannu(at)skype(dot)net>
2005-12-08 07:08:10 from "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
2005-12-08 09:58:50 from Hannu Krosing <hannu(at)skype(dot)net>
2005-12-08 18:57:02 from "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
2005-12-08 22:00:14 from Hannu Krosing <hannu(at)skype(dot)net>
2005-12-08 23:03:21 from "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
2006-03-03 03:12:59 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2006-03-03 22:46:39 from "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
2006-03-04 05:02:06 from Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
2005-12-02 22:41:15 from Jochem van Dieten <jochemd(at)gmail(dot)com>
2005-12-02 23:32:57 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-12-03 21:45:14 from Jochem van Dieten <jochemd(at)gmail(dot)com>
2005-12-03 15:23:06 from Greg Stark <gsstark(at)mit(dot)edu>
2005-12-03 16:30:31 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-12-03 19:01:02 from Greg Stark <gsstark(at)mit(dot)edu>
2005-12-08 06:04:59 from "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
2005-12-03 13:47:36 from Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
2005-12-03 19:39:53 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2005-12-03 20:16:27 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2005-12-03 23:32:17 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2005-12-08 20:34:03 from Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
2005-12-05 14:03:30 from Hannu Krosing <hannu(at)skype(dot)net>
2005-12-06 19:50:45 from Jochem van Dieten <jochemd(at)gmail(dot)com>
2005-12-06 20:12:40 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-12-06 20:29:27 from Hannu Krosing <hannu(at)skype(dot)net>
2005-12-06 20:41:28 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-12-06 20:58:06 from Hannu Krosing <hannu(at)skype(dot)net>
2005-12-06 21:01:57 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-12-06 21:07:45 from Hannu Krosing <hannu(at)skype(dot)net>
2005-12-07 18:01:35 from Jochem van Dieten <jochemd(at)gmail(dot)com>
2005-12-06 20:26:02 from Hannu Krosing <hannu(at)skype(dot)net>
2005-12-06 20:38:38 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-12-06 20:45:31 from Hannu Krosing <hannu(at)skype(dot)net>
2005-12-07 00:32:30 from Greg Stark <gsstark(at)mit(dot)edu>
2005-12-07 07:43:08 from Hannu Krosing <hannu(at)skype(dot)net>
2005-12-07 18:36:07 from Greg Stark <gsstark(at)mit(dot)edu>
2005-12-07 20:33:13 from Hannu Krosing <hannu(at)skype(dot)net>
2005-12-08 10:05:17 from Csaba Nagy <nagy(at)ecircle-ag(dot)com>
2005-12-08 09:14:34 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2005-12-08 15:05:15 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-12-08 15:23:57 from Csaba Nagy <nagy(at)ecircle-ag(dot)com>
2005-12-08 18:25:26 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2005-12-08 19:53:24 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-12-11 01:55:38 from Hannu Krosing <hannu(at)skype(dot)net>
2005-12-11 02:07:44 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2005-12-11 13:28:10 from Simon Riggs <simon(at)2ndquadrant(dot)com>
2005-12-11 18:33:57 from Hannu Krosing <hannu(at)skype(dot)net>
2005-12-12 14:02:50 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Lists:
pgsql-hackers
Jochem van Dieten <jochemd(at)gmail(dot)com> writes:
> How about the following sceanrio for building a new index:
> - create an empty index
> - flag it as incomplete
> - commit it so it becomes visible to new transactions
> - new transactions will update the index when inserting / updating
> - the planner will not use it for queries because it is flagged as incomplete
> - wait until the the index is visible to all running transactions
> - start a new seqscan and insert all records in the index
> - commit
> - remove the incomplete flag
> Wouldn't this overcome the lock upgrade problem?
Doesn't really solve the problem for REINDEX, though. Presumably, the
reason that you are REINDEXing is that you would like to defragment the
existing index. Well, that requires collecting all the index entries
and sorting them. The above method is not going to produce a nicely
sorted index; whatever entries get made on-the-fly during the first
stage are going to determine the index shape.
This same problem applies to the build-lock-catchup paradigm, although
less severely since you can hope that the entries to be added on at the
end are only a small part of the total and will fit in the excess space
that you leave in the index leaf pages. If you spend too long catching
up, though (as in the multiple-pass ideas that various people were
advocating), you'll end up with an index messy enough that it's
questionable why you bothered.
regards, tom lane
In response to
Responses
pgsql-hackers by date
Next :From: Tom LaneDate: 2005-12-02 23:38:01
Subject : Re: Numeric 508 datatype
Previous :From : Marc G. FournierDate : 2005-12-02 23:19:31
Subject : Re: Spam 508