Re: Help with count(*)

From: Christopher Browne <cbbrowne(at)acm(dot)org>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Help with count(*)
Date: 2003-11-14 19:16:56
Message-ID: m3he16kbfb.fsf@wolfe.cbbrowne.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

After a long battle with technology, hannu(at)tm(dot)ee (Hannu Krosing), an earthling, wrote:
> Christopher Browne kirjutas R, 14.11.2003 kell 16:13:
>> Martha Stewart called it a Good Thing when mallah(at)trade-india(dot)com (Rajesh Kumar Mallah) wrote:
>> > INFO: "profiles": found 0 removable, 369195 nonremovable row versions in 43423 pages
>> > DETAIL: 246130 dead row versions cannot be removed yet.
>> > Nonremovable row versions range from 136 to 2036 bytes long.
>>
>> It seems as though you have a transaction open that is holding onto a
>> whole lot of old rows.
>>
>> I have seen this happen somewhat-invisibly when a JDBC connection
>> manager opens transactions for each connection, and then no processing
>> happens to use those connections for a long time. The open
>> transactions prevent vacuums from doing any good...
>
> Can't the backend be made to delay the "real" start of transaction until
> the first query gets executed ?

One would hope so. Some time when I have the Round Tuits, I ought to
take a browse of the connection pool code to notice if there's
anything to notice.

The thing that I keep imagining would be a slick idea would be to have
a thread periodically go through once for however many connections the
pool permits and fire a short transaction through every
otherwise-unoccupied connection in the pool, in effect, doing a sort
of "vacuum" of the connections. I don't get very favorable reactions
when I suggest that, though...
--
(reverse (concatenate 'string "ac.notelrac.teneerf" "@" "454aa"))
http://cbbrowne.com/info/sgml.html
Rules of the Evil Overlord #80. "If my weakest troops fail to
eliminate a hero, I will send out my best troops instead of wasting
time with progressively stronger ones as he gets closer and closer to
my fortress." <http://www.eviloverlord.com/>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-11-14 19:17:27 Re: [CORE] 7.4RC2 regression failur and not running stats collector process
Previous Message Peter Eisentraut 2003-11-14 19:16:30 Re: [HACKERS] XML Docbook

Browse pgsql-performance by date

  From Date Subject
Next Message Rajesh Kumar Mallah 2003-11-14 19:27:41 Re: IN surpasses NOT EXISTS in 7.4RC2 ??
Previous Message Tom Lane 2003-11-14 18:49:59 Re: Help with count(*)