提交 f56b5fb2 编写于 作者: A Ashwin Agrawal

Remove rd_issyscat from RelationData.

Greenplum added rd_isyscat to Relation structure. Only usage of the same is in
markDirty() to decide if buffer should be marked dirty or not. The setting of
rd_issyscat is based in checking if relation name starts with "pg_" then set it
else not. Which anyways is very loose.

Modified instead to just make check based on if oid < FirstNormalObjectId or to
cover for pg_aoseg tables RelationGetNamespace(relation) ==
PG_AOSEGMENT_NAMESPACE. So, this allows us to remove the extra variable.

This patch is not trying to change the intent of GUC
`gp_disable_tuple_hints`. That's all together different discussion.
上级 a8f6260e
......@@ -866,7 +866,6 @@ RelationBuildDesc(Oid targetRelId, bool insertIt)
relation->rd_isnailed = false;
relation->rd_createSubid = InvalidSubTransactionId;
relation->rd_newRelfilenodeSubid = InvalidSubTransactionId;
relation->rd_issyscat = (strncmp(relation->rd_rel->relname.data, "pg_", 3) == 0);
switch (relation->rd_rel->relpersistence)
{
......@@ -1414,7 +1413,6 @@ formrdesc(const char *relationName, Oid relationReltype,
relation->rd_createSubid = InvalidSubTransactionId;
relation->rd_newRelfilenodeSubid = InvalidSubTransactionId;
relation->rd_backend = InvalidBackendId;
relation->rd_issyscat = (strncmp(relationName, "pg_", 3) == 0); /* GP */
/*
* initialize relation tuple form
......@@ -2636,9 +2634,6 @@ RelationBuildLocalRelation(const char *relname,
/* must flag that we have rels created in this transaction */
need_eoxact_work = true;
/* is it a system catalog? */
rel->rd_issyscat = (strncmp(relname, "pg_", 3) == 0);
/*
* create a new tuple descriptor from the one passed in. We do this
* partly to copy it into the cache context, and partly because the new
......
......@@ -65,6 +65,7 @@
#include "storage/procarray.h"
#include "utils/tqual.h"
#include "catalog/pg_namespace.h"
#include "cdb/cdbtm.h"
#include "cdb/cdbvars.h"
......@@ -100,12 +101,13 @@ markDirty(Buffer buffer, Relation relation, HeapTupleHeader tuple, bool isXmin)
}
/*
* The GUC gp_disable_tuple_hints is on. Do further evaluation whether we want to write out the
* buffer or not.
* The GUC gp_disable_tuple_hints is on. Do further evaluation whether we
* want to write out the buffer or not.
*/
Assert(relation != NULL);
if (relation->rd_issyscat)
if (RelationGetRelid(relation) < FirstNormalObjectId ||
RelationGetNamespace(relation) == PG_AOSEGMENT_NAMESPACE)
{
/* Assume we want to always mark the buffer dirty */
MarkBufferDirtyHint(buffer);
......
......@@ -136,8 +136,6 @@ typedef struct RelationData
struct SMgrRelationData *rd_smgr; /* cached file handle, or NULL */
int rd_refcnt; /* reference count */
BackendId rd_backend; /* owning backend id, if temporary relation */
// GPDB_91_MERGE_FIXME: is rd_issyscat still needed?
bool rd_issyscat; /* GP: true => system catalog table (has "pg_" prefix) */
bool rd_isnailed; /* rel is nailed in cache */
bool rd_isvalid; /* relcache entry is valid */
char rd_indexvalid; /* state of rd_indexlist: 0 = not valid, 1 =
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册