Re: I/O on select count(*)

Поиск
Список
Период
Сортировка
Искать
От
Alvaro Herrera
Тема
Re: I/O on select count(*)
Дата
в 17:15:46
Msg-id
20080516201528.GJ13061@alvh.no-ip.org
Ответ на
Список
Дерево обсуждения
I/O on select count(*) Doug Eck <deck1@yahoo.com>
Re: I/O on select count(*) "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: I/O on select count(*) Greg Smith <gsmith@gregsmith.com>
Re: I/O on select count(*) Alvaro Herrera <alvherre@commandprompt.com>
Re: I/O on select count(*) James Mansion <james@mansionfamily.plus.com>
Re: I/O on select count(*) "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: I/O on select count(*) Greg Smith <gsmith@gregsmith.com>
Re: I/O on select count(*) "Jan de Visser" <jdevisser@digitalfairway.com>
Re: I/O on select count(*) Tom Lane <tgl@sss.pgh.pa.us>
Re: I/O on select count(*) Jan de Visser <jdevisser@digitalfairway.com>
Re: I/O on select count(*) Robert Lor <Robert.Lor@Sun.COM>
Re: I/O on select count(*) Tom Lane <tgl@sss.pgh.pa.us>
Re: I/O on select count(*) Robert Lor <Robert.Lor@Sun.COM>
Re: I/O on select count(*) Tom Lane <tgl@sss.pgh.pa.us>
Re: I/O on select count(*) "Pavan Deolasee" <pavan.deolasee@gmail.com>
Re: I/O on select count(*) Luke Lonergan <llonergan@greenplum.com>
Re: I/O on select count(*) "Joshua D. Drake" <jd@commandprompt.com>
Re: I/O on select count(*) Tino Wildenhain <tino@wildenhain.de>
Re: I/O on select count(*) Gregory Stark <stark@enterprisedb.com>
Re: I/O on select count(*) Matthew Wakeling <matthew@flymine.org>
Re: I/O on select count(*) Ron Mayer <rm_pg@cheapcomplexdevices.com>
Re: I/O on select count(*) Greg Smith <gsmith@gregsmith.com>
Re: I/O on select count(*) Alvaro Herrera <alvherre@commandprompt.com>
Re: I/O on select count(*) "Heikki Linnakangas" <heikki@enterprisedb.com>
Re: I/O on select count(*) Alvaro Herrera <alvherre@commandprompt.com>
Re: I/O on select count(*) Tom Lane <tgl@sss.pgh.pa.us>
Re: I/O on select count(*) Matthew Wakeling <matthew@flymine.org>
Re: I/O on select count(*) Alvaro Herrera <alvherre@commandprompt.com>
Re: I/O on select count(*) Greg Smith <gsmith@gregsmith.com>
Re: I/O on select count(*) Simon Riggs <simon@2ndquadrant.com>
Re: I/O on select count(*) Alvaro Herrera <alvherre@commandprompt.com>
Re: I/O on select count(*) Tom Lane <tgl@sss.pgh.pa.us>
Re: I/O on select count(*) Jeremy Harris <jgh@wizmail.org>
Re: I/O on select count(*) Greg Smith <gsmith@gregsmith.com>
Re: I/O on select count(*) Decibel! <decibel@decibel.org>
Re: I/O on select count(*) Decibel! <decibel@decibel.org>
Re: I/O on select count(*) "Heikki Linnakangas" <heikki@enterprisedb.com>
Re: I/O on select count(*) Tom Lane <tgl@sss.pgh.pa.us>
Re: I/O on select count(*) Simon Riggs <simon@2ndquadrant.com>
Re: I/O on select count(*) Matthew Wakeling <matthew@flymine.org>
Re: I/O on select count(*) Bruce Momjian <bruce@momjian.us>
Re: I/O on select count(*) Tom Lane <tgl@sss.pgh.pa.us>
Re: I/O on select count(*) Greg Smith <gsmith@gregsmith.com>
Re: I/O on select count(*) Tom Lane <tgl@sss.pgh.pa.us>
Re: I/O on select count(*) PFC <lists@peufeu.com>
Re: I/O on select count(*) Alvaro Herrera <alvherre@commandprompt.com>
Re: I/O on select count(*) "Heikki Linnakangas" <heikki@enterprisedb.com>
Re: I/O on select count(*) Matthew Wakeling <matthew@flymine.org>
Re: I/O on select count(*) Tom Lane <tgl@sss.pgh.pa.us>
Re: I/O on select count(*) "Heikki Linnakangas" <heikki@enterprisedb.com>
Re: I/O on select count(*) Matthew Wakeling <matthew@flymine.org>
Re: I/O on select count(*) "Merlin Moncure" <mmoncure@gmail.com>
Greg Smith wrote:

> After reading the code and that documentation a bit, the part I'm still  
> not sure about is whether the CLOG entry is created when the XID is  
> assigned and then kept current as the state changes, or whether that 
> isn't even in CLOG until the transaction is committed.  It seems like the 
> latter, but there's some ambiguity in the wording and too many code paths 
> for me to map right now.

pg_clog is allocated in pages of 8kB apiece(*).  On allocation, pages are
zeroed, which is the bit pattern for "transaction in progress".  So when
a transaction starts, it only needs to ensure that the pg_clog page that
corresponds to it is allocated, but it need not write anything to it.

(*) Each transaction needs 2 bits, so on a 8 kB page there is space for
4 transactions/byte * 8 pages * 1kB/page = 32k transactions.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
В списке pgsql-performance по дате отправления
От: Craig Ringer
Дата:
Сообщение: Re: very slow left join
От: Scott Marlowe
Дата:
FAQ