pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Clarification on the release notes of postgresql 12 regarding pg_upgrade
6+ messages / 6 participants
[nested] [flat]

* Clarification on the release notes of postgresql 12 regarding pg_upgrade
@ 2019-10-04 13:00  Marcelo Lacerda <marceloslacerda@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Marcelo Lacerda @ 2019-10-04 13:00 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

There are a few instances where the release notes seem to indicate that the
administrator should use pg_dump to upgrade a database so that improvements
on btree can be available.

Here are they:

1.

>In new btree indexes, the maximum index entry length is reduced by eight
bytes, to improve handling of duplicate entries (Peter Geoghegan)
-

> This means that a REINDEX
<https://www.postgresql.org/docs/12/sql-reindex.html; operation on an index
pg_upgrade'd from a previous release could potentially fail.
-
- 2.
>Improve performance and space utilization of btree indexes with many
duplicates (Peter Geoghegan, Heikki Linnakangas)
>...
>Indexes pg_upgrade'd from previous releases will not have these benefits.

3.
>Allow multi-column btree indexes to be smaller (Peter Geoghegan, Heikki
Linnakangas)
>...
>Indexes pg_upgrade'd from previous releases will not have these benefits.


My questions are:

1. Is this a current limitation of pg_upgrade that will be dealt afterwards?

2. Are we going to see more of such cases were pg_upgrade leaves the
database incompatible with newer features.

3. What's the recommendation for administrators with databases that are too
large to be upgraded with pg_dump?

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Clarification on the release notes of postgresql 12 regarding pg_upgrade
@ 2019-10-04 14:06  Laurenz Albe <laurenz.albe@cybertec.at>
  parent: Marcelo Lacerda <marceloslacerda@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Laurenz Albe @ 2019-10-04 14:06 UTC (permalink / raw)
  To: Marcelo Lacerda <marceloslacerda@gmail.com>; pgsql-general@lists.postgresql.org

On Fri, 2019-10-04 at 10:00 -0300, Marcelo Lacerda wrote:
> There are a few instances where the release notes seem to indicate
> that the administrator should use pg_dump to upgrade a database so
> that improvements on btree can be available. 
> 
> Here are they:
> 
> 1.
> 
> >In new btree indexes, the maximum index entry length is reduced by
> eight bytes, to improve handling of duplicate entries (Peter
> Geoghegan)
> > This means that a REINDEX operation on an index pg_upgrade'd from a
> previous release could potentially fail.
> 
> 
> 2.
> >Improve performance and space utilization of btree indexes with many
> duplicates (Peter Geoghegan, Heikki Linnakangas)
> >...
> >Indexes pg_upgrade'd from previous releases will not have these
> benefits.
> 
> 3.
> >Allow multi-column btree indexes to be smaller (Peter Geoghegan,
> Heikki Linnakangas)
> >...
> >Indexes pg_upgrade'd from previous releases will not have these
> benefits.
> 
> 
> My questions are:
> 
> 1. Is this a current limitation of pg_upgrade that will be dealt
> afterwards?
> 
> 2. Are we going to see more of such cases were pg_upgrade leaves the
> database incompatible with newer features.
> 
> 3. What's the recommendation for administrators with databases that
> are too large to be upgraded with pg_dump?

pg_upgrade doesn't touch the index data, so it cannot rewrite indexes
to take advantage of these improvements.

There is no incompatibility involved.

You can always REINDEX some indexes later.
Now that we have REINDEX CONCURRENTLY, it shouldn't hurt as much.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com






^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Clarification on the release notes of postgresql 12 regarding pg_upgrade
@ 2019-10-04 14:13  Josef Šimánek <josef.simanek@gmail.com>
  parent: Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 6+ messages in thread

From: Josef Šimánek @ 2019-10-04 14:13 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: Marcelo Lacerda <marceloslacerda@gmail.com>; pgsql-general@lists.postgresql.org

But the problem in this case is probably this note:

> This means that a REINDEX
<https://www.postgresql.org/docs/12/sql-reindex.html; operation on an
index pg_upgrade'd from a previous release could potentially fail.

You can't REINDEX safely regarding that note.

pá 4. 10. 2019 v 16:06 odesílatel Laurenz Albe <laurenz.albe@cybertec.at>
napsal:

> On Fri, 2019-10-04 at 10:00 -0300, Marcelo Lacerda wrote:
> > There are a few instances where the release notes seem to indicate
> > that the administrator should use pg_dump to upgrade a database so
> > that improvements on btree can be available.
> >
> > Here are they:
> >
> > 1.
> >
> > >In new btree indexes, the maximum index entry length is reduced by
> > eight bytes, to improve handling of duplicate entries (Peter
> > Geoghegan)
> > > This means that a REINDEX operation on an index pg_upgrade'd from a
> > previous release could potentially fail.
> >
> >
> > 2.
> > >Improve performance and space utilization of btree indexes with many
> > duplicates (Peter Geoghegan, Heikki Linnakangas)
> > >...
> > >Indexes pg_upgrade'd from previous releases will not have these
> > benefits.
> >
> > 3.
> > >Allow multi-column btree indexes to be smaller (Peter Geoghegan,
> > Heikki Linnakangas)
> > >...
> > >Indexes pg_upgrade'd from previous releases will not have these
> > benefits.
> >
> >
> > My questions are:
> >
> > 1. Is this a current limitation of pg_upgrade that will be dealt
> > afterwards?
> >
> > 2. Are we going to see more of such cases were pg_upgrade leaves the
> > database incompatible with newer features.
> >
> > 3. What's the recommendation for administrators with databases that
> > are too large to be upgraded with pg_dump?
>
> pg_upgrade doesn't touch the index data, so it cannot rewrite indexes
> to take advantage of these improvements.
>
> There is no incompatibility involved.
>
> You can always REINDEX some indexes later.
> Now that we have REINDEX CONCURRENTLY, it shouldn't hurt as much.
>
> Yours,
> Laurenz Albe
> --
> Cybertec | https://www.cybertec-postgresql.com
>
>
>
>

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Clarification on the release notes of postgresql 12 regarding pg_upgrade
@ 2019-10-04 16:09  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Josef Šimánek <josef.simanek@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Tom Lane @ 2019-10-04 16:09 UTC (permalink / raw)
  To: Josef Šimánek <josef.simanek@gmail.com>; +Cc: Laurenz Albe <laurenz.albe@cybertec.at>; Marcelo Lacerda <marceloslacerda@gmail.com>; pgsql-general@lists.postgresql.org

=?UTF-8?B?Sm9zZWYgxaBpbcOhbmVr?= <josef.simanek@gmail.com> writes:
> But the problem in this case is probably this note:
>> This means that a REINDEX
>> <https://www.postgresql.org/docs/12/sql-reindex.html; operation on an
>> index pg_upgrade'd from a previous release could potentially fail.

> You can't REINDEX safely regarding that note.

Actually running into that problem is quite unlikely; and if you did
hit it, it'd just mean that the REINDEX fails, not that you have any
urgent problem to fix.  I'd encourage you to just go ahead and REINDEX,
if you have indexes that could benefit from the other changes.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Clarification on the release notes of postgresql 12 regarding pg_upgrade
@ 2019-10-04 16:43  Peter Geoghegan <pg@bowt.ie>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 6+ messages in thread

From: Peter Geoghegan @ 2019-10-04 16:43 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Josef Šimánek <josef.simanek@gmail.com>; Laurenz Albe <laurenz.albe@cybertec.at>; Marcelo Lacerda <marceloslacerda@gmail.com>; pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>

On Fri, Oct 4, 2019 at 9:09 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > You can't REINDEX safely regarding that note.
>
> Actually running into that problem is quite unlikely; and if you did
> hit it, it'd just mean that the REINDEX fails, not that you have any
> urgent problem to fix.  I'd encourage you to just go ahead and REINDEX,
> if you have indexes that could benefit from the other changes.

Right. It is hard to imagine an application that evolved to fully rely
on the previous slightly higher limit, and cannot tolerate a reduction
in the limit by only 8 bytes. The limit applies to a tuple *after*
TOAST compression has been applied.

-- 
Peter Geoghegan





^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Clarification on the release notes of postgresql 12 regarding pg_upgrade
@ 2019-10-04 22:19  Bruce Momjian <bruce@momjian.us>
  parent: Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 6+ messages in thread

From: Bruce Momjian @ 2019-10-04 22:19 UTC (permalink / raw)
  To: Peter Geoghegan <pg@bowt.ie>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; Josef Šimánek <josef.simanek@gmail.com>; Laurenz Albe <laurenz.albe@cybertec.at>; Marcelo Lacerda <marceloslacerda@gmail.com>; pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>

On Fri, Oct  4, 2019 at 09:43:31AM -0700, Peter Geoghegan wrote:
> On Fri, Oct 4, 2019 at 9:09 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > > You can't REINDEX safely regarding that note.
> >
> > Actually running into that problem is quite unlikely; and if you did
> > hit it, it'd just mean that the REINDEX fails, not that you have any
> > urgent problem to fix.  I'd encourage you to just go ahead and REINDEX,
> > if you have indexes that could benefit from the other changes.
> 
> Right. It is hard to imagine an application that evolved to fully rely
> on the previous slightly higher limit, and cannot tolerate a reduction
> in the limit by only 8 bytes. The limit applies to a tuple *after*
> TOAST compression has been applied.

Right.  Pg_upgrade is fast, but we don't want it limiting file format
changes that can improve Postgres.  Allowing REINDEX to fix things is
the best of both worlds --- fast upgrades, and after some REINDEX-ing,
faster Postgres.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +





^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2019-10-04 22:19 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-10-04 13:00 Clarification on the release notes of postgresql 12 regarding pg_upgrade Marcelo Lacerda <marceloslacerda@gmail.com>
2019-10-04 14:06 ` Laurenz Albe <laurenz.albe@cybertec.at>
2019-10-04 14:13   ` Josef Šimánek <josef.simanek@gmail.com>
2019-10-04 16:09     ` Tom Lane <tgl@sss.pgh.pa.us>
2019-10-04 16:43       ` Peter Geoghegan <pg@bowt.ie>
2019-10-04 22:19         ` Bruce Momjian <bruce@momjian.us>

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