Re: Legacy GiST invalid tuples - Mailing list pgsql-hackers

From Andrey Borodin
Subject Re: Legacy GiST invalid tuples
Date
Msg-id A2E657C5-EE62-4DB8-92B6-5D1553DA1C08@yandex-team.ru
Whole thread Raw
In response to Re: Legacy GiST invalid tuples  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Legacy GiST invalid tuples  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers

> 4 июля 2018 г., в 19:22, Tom Lane <tgl@sss.pgh.pa.us> написал(а):
>
> Andrey Borodin <x4mmm@yandex-team.ru> writes:
>> There is bunch of code in current GiST implementation checking for GistTupleIsInvalid(). PostgreSQL since 9.1 do not
createinvalid tuples. Should we support this tuples forever? 
>
> The question is not whether we still create such tuples.  The reason
> the code is still there is that an index that's been pg_upgraded from
> before 9.1 might still contain such tuples.  We can't drop the support
> unless either we provide logic to clean up invalid entries, or we're
> willing to force users to REINDEX old GiST indexes to get rid of them
> that way.  The latter seems like a pretty high price just to get rid of
> some crufty old code.

Thanks, Tom!

So, I can create the script for pg_upgrade that will walk through each old enough[0] GiST index, scan for invalid
tuplesand repair them. This procedure seems quite trivial, but there will be more code that we have now. Does it sound
reasonable?

[0] Actually, I do not know how to understand which index is old enough.

Best regards, Andrey Borodin.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Legacy GiST invalid tuples
Next
From: Sergei Kornilov
Date:
Subject: Re: New function pg_stat_statements_reset_query() to reset statisticsof a specific query