Movatterモバイル変換


[0]ホーム

URL:


Quick Links

pointless check in RelationBuildPartitionDesc

From:Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To:Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject:pointless check in RelationBuildPartitionDesc
Date:2018-09-03 21:39:16
Message-ID:20180903213916.hh6wasnrdg6xv2ud@alvherre.pgsql
Views:Whole Thread |Raw Message |Download mbox |Resend email
Thread:
Lists:pgsql-hackers

I noticed this strange hack in RelationBuildPartitionDesc:

/*
* It is possible that the pg_class tuple of a partition has not been
* updated yet to set its relpartbound field. The only case where
* this happens is when we open the parent relation to check using its
* partition descriptor that a new partition's bound does not overlap
* some existing partition.
*/
if (!((Form_pg_class) GETSTRUCT(tuple))->relispartition)
{
ReleaseSysCache(tuple);
continue;
}

After looking, it seems that this is just self-inflicted pain: for some
reason, we store the pg_inherits row for a partition, and immediately
afterwards compute and store its partition bound, which requires the
above hack. But if we do things in the opposite order, this is no
longer needed. I propose to remove it, as in the attached patch.

--
Álvaro Herrera Developer,https://www.PostgreSQL.org/

AttachmentContent-TypeSize
ispartition.patchtext/plain1.8 KB

Responses

Browse pgsql-hackers by date

 FromDateSubject
Next MessageAndres Freund2018-09-03 21:53:59Re: Caching query plan costs
Previous MessageAlexander Korotkov2018-09-03 21:30:42Re: [HACKERS] Bug in to_timestamp().

[8]ページ先頭

©2009-2025 Movatter.jp