Re: Read-only tables to avoid row visibility check - Mailing list pgsql-general

From Merlin Moncure
Subject Re: Read-only tables to avoid row visibility check
Date
Msg-id CAHyXU0yNbOSDBeDhGJ_CVQ4v46KsVqfUq4wjiRH8QzD3yRPCWA@mail.gmail.com
Whole thread Raw
In response to Read-only tables to avoid row visibility check  (Seamus Abshere <seamus@abshere.net>)
List pgsql-general
On Mon, Feb 22, 2016 at 2:35 PM, Seamus Abshere <seamus@abshere.net> wrote:
> hi,
>
> https://wiki.postgresql.org/wiki/ReadOnlyTables mentions the possibility
> of `ALTER TABLE table SET READ ONLY`.
>
> Would this mean that row visibility checks could be skipped and thus
> index-only scans much more common?

Personally I don't see how that buys you very much.  Right now you can
VACUUM the table which will update the visibility map, allowing index
only scans to be chosen.  Visibility checks are also already optimized
away by the database over time via hint bits.

I think the optimization you are looking for is to have the database
exploit the fact that when the table is created and/or loaded in a
single transaction, it marks everything visible and valid by default
and then wipes it all away should the insert fail.

merlin


pgsql-general by date:

Previous
From: Nicklas Aven
Date:
Subject: Re: ERROR: cannot convert relation containing dropped columns to view
Next
From: Melvin Davidson
Date:
Subject: Re: Get the date of creation of objects in the database