pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: pf@pfortin.com
To: pgsql-general@lists.postgresql.org
Subject: Re: [SOLVED?] Re: Disk wait problem... not hardware...
Date: Sun, 29 Oct 2023 10:03:14 -0700
Message-ID: <078dba52-de8b-46e3-a5d8-110145940b1a@aklaver.com> (raw)
In-Reply-To: <20231029124508.71a8ce22.pfortin@pfortin.com>
References: <fe8042a8-5747-466e-ac8a-de3c5b6a469c@aklaver.com>
	<20231023175529.59f309bb@pfortin.com>
	<9938ff1a-8837-454b-a50c-a748e84c172a@aklaver.com>
	<20231026095000.4swq6vbgdsw3palp@hjp.at>
	<20231026155016.6b739a7e.pfortin@pfortin.com>
	<20231026220325.2204a3f6.pfortin@pfortin.com>
	<20231027170711.xgz3xrf7cujx7udh@hjp.at>
	<20231027194609.1bf96324.pfortin@pfortin.com>
	<CAB_5SRd_z8eL-uypDTRVBNweJio_p9+M3RgkbWyO5zt4MB0Hvg@mail.gmail.com>
	<20231029092146.53351f7e@pfortin.com>
	<20231029151605.kijo6gumeen7jj26@hjp.at>
	<20231029124508.71a8ce22.pfortin@pfortin.com>

On 10/29/23 09:45, pf@pfortin.com wrote:
> On Sun, 29 Oct 2023 16:16:05 +0100 Peter J. Holzer wrote:
> 
>> On 2023-10-29 09:21:46 -0400, pf@pfortin.com wrote:
>>> These are all static tables. Does PG maintain a table row count so as to
>>> avoid having to count each time?
>>
>> No. To count the rows in a table, Postgres has to actually read the
>> whole table (or an index, if a suitable index (e.g. a primary key)
>> exists).
> 
> Am I correct to assume count(fieldname) would only load that column for
> counting?  In other words: we should be specific (avoid "*") in general?

Read:

https://wiki.postgresql.org/wiki/Slow_Counting


>>> WB is setup to:
>>> * autoload table row count
>>> * autoload table data (restricted with LIMIT)
>>
>> Maybe WB can be set up to get n_live_tup instead of the real row count?

So basically you are dealing with a client issue.

> 
> It appears this is hard-coded [on/off only]; but I thought I saw the WB
> author post on this list recently...
> 
>>         hp
>>
> 
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com






view thread (6+ messages)  latest in thread

Message-ID: <078dba52-de8b-46e3-a5d8-110145940b1a@aklaver.com>
Permalink:  ../078dba52-de8b-46e3-a5d8-110145940b1a@aklaver.com/
Also on:    postgresql.org/message-id/078dba52-de8b-46e3-a5d8-110145940b1a@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, pf@pfortin.com
  Subject: Re: [SOLVED?] Re: Disk wait problem... not hardware...
  In-Reply-To: <078dba52-de8b-46e3-a5d8-110145940b1a@aklaver.com>
  References: <fe8042a8-5747-466e-ac8a-de3c5b6a469c@aklaver.com> <20231023175529.59f309bb@pfortin.com> <9938ff1a-8837-454b-a50c-a748e84c172a@aklaver.com> <20231026095000.4swq6vbgdsw3palp@hjp.at> <20231026155016.6b739a7e.pfortin@pfortin.com> <20231026220325.2204a3f6.pfortin@pfortin.com> <20231027170711.xgz3xrf7cujx7udh@hjp.at> <20231027194609.1bf96324.pfortin@pfortin.com> <CAB_5SRd_z8eL-uypDTRVBNweJio_p9+M3RgkbWyO5zt4MB0Hvg@mail.gmail.com> <20231029092146.53351f7e@pfortin.com> <20231029151605.kijo6gumeen7jj26@hjp.at> <20231029124508.71a8ce22.pfortin@pfortin.com> <078dba52-de8b-46e3-a5d8-110145940b1a@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox