Re: Why not represent "never vacuumed" accurately wrt pg_class.relpages?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Why not represent "never vacuumed" accurately wrt pg_class.relpages?
Date: 2018-12-11 14:47:38
Message-ID: 7951.1544539658@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> I don't quite get why we don't instead just represent "never vacuumed"
> by storing a more meaningful value in relpages?

Mostly, not wanting to break clients that look at these fields.
If catalog compatibility weren't a concern, I'd seriously consider
replacing both of them with a float "average tuples per page" ratio.

> We could go for
> InvalidBlockNumber, or even NULL (although the latter would be a bit
> annoying due to not being mappable to a struct anymore).

NULL seems right out on every ground. I don't much care for
InvalidBlockNumber either.

> I've seen numerous cases where relpages = 0 -> never vacuumed has caused
> worse plans, and it just doesn't seem necessary?

Worse plans than what? And why do you blame it on this representation?
We don't believe that relpages is the actual size of the table.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pablo Iranzo Gómez 2018-12-11 14:52:40 Re: Introducing SNI in TLS handshake for SSL connections
Previous Message David Steele 2018-12-11 14:15:16 Re: Add timeline to partial WAL segments