Re: [EXT] Re: Improve "select count(*)" query - takes more than 30 mins for some large tables

From: MichaelDBA <MichaelDBA(at)sqlexec(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: "Pierson Patricia L (Contractor)" <Patricia(dot)L(dot)Pierson(at)irs(dot)gov>, "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: [EXT] Re: Improve "select count(*)" query - takes more than 30 mins for some large tables
Date: 2022-07-13 02:12:56
Message-ID: b76730ff-dd92-d4d6-60cf-64d00dc4db43@sqlexec.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Laurenz,

Oh really? Even if it did an INDEX ONLY SCAN, it would still be slower
because it still has to access the heap in a random I/O kinda way  (like
I said-->"The heap always gets accessed for select counts") because
visibility info is only found in the HEAP not the index.

Laurenz Albe wrote on 7/12/2022 3:13 PM:
> I'd say that both statements are wrong:

Regards,

Michael Vitale

Michaeldba(at)sqlexec(dot)com <mailto:michaelvitale(at)sqlexec(dot)com>

703-600-9343

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Ribe 2022-07-13 02:28:42 Re: [EXT] Improve "select count(*)" query - takes more than 30 mins for some large tables
Previous Message Laurenz Albe 2022-07-12 19:13:27 Re: [EXT] Re: Improve "select count(*)" query - takes more than 30 mins for some large tables