pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: MichaelDBA <MichaelDBA@sqlexec.com>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Pierson Patricia L (Contractor) <Patricia.L.Pierson@irs.gov>
Cc: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Re: [EXT] Re: Improve "select count(*)" query - takes more than 30 mins for some large tables
Date: Tue, 12 Jul 2022 22:12:56 -0400
Message-ID: <b76730ff-dd92-d4d6-60cf-64d00dc4db43@sqlexec.com> (raw)
In-Reply-To: <05fa08bf8b4e1023eb879bcab0f83d428e4f7a43.camel@cybertec.at>
References: <CACxU--UJY4sD2SjW8V3W0oAPuuTzE3fAvBzTaej-BmUUNJxN_Q@mail.gmail.com>
	<1B1927BA-F7DE-40E8-8F67-BCC001CD4C6B@gmail.com>
	<1eb233ff-90f0-529b-f0cc-fa982f668a8f@gmail.com>
	<1221536526.20277.1657636277921@email.ionos.com>
	<CALcG2D+JJMK13U3qV_pn8np+m2urGJ7iyj_hB0Mt9XfM8GU-vw@mail.gmail.com>
	<SJ0PR09MB6061D637A2A7988D19DC506FC7869@SJ0PR09MB6061.namprd09.prod.outlook.com>
	<1037158693.49441.1657650345834@email.ionos.com>
	<05fa08bf8b4e1023eb879bcab0f83d428e4f7a43.camel@cybertec.at>

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@sqlexec.com <mailto:michaelvitale@sqlexec.com>

703-600-9343

Attachments:

pgadvanced3.jpg (image/jpeg, 20.6K) download view image

view thread (15+ messages)  latest in thread

Message-ID: <b76730ff-dd92-d4d6-60cf-64d00dc4db43@sqlexec.com>
Permalink:  ../b76730ff-dd92-d4d6-60cf-64d00dc4db43@sqlexec.com/
Also on:    postgresql.org/message-id/b76730ff-dd92-d4d6-60cf-64d00dc4db43@sqlexec.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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: MichaelDBA@sqlexec.com, laurenz.albe@cybertec.at, Patricia.L.Pierson@irs.gov, pgsql-admin@lists.postgresql.org
  Subject: Re: [EXT] Re: Improve "select count(*)" query - takes more than 30 mins for some large tables
  In-Reply-To: <b76730ff-dd92-d4d6-60cf-64d00dc4db43@sqlexec.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