mirror of
https://github.com/postgres/postgres.git
synced 2025-05-05 09:19:17 +03:00
Improve WAL record descriptions for SP-GiST records.
While tracking down the bug fixed in the preceding commit, I got quite annoyed by the low quality of spg_desc's output. Add missing fields, try to make the formatting consistent.
This commit is contained in:
parent
9e41148229
commit
783be78ca9
@ -28,10 +28,9 @@ spg_desc(StringInfo buf, XLogReaderState *record)
|
|||||||
{
|
{
|
||||||
spgxlogAddLeaf *xlrec = (spgxlogAddLeaf *) rec;
|
spgxlogAddLeaf *xlrec = (spgxlogAddLeaf *) rec;
|
||||||
|
|
||||||
appendStringInfoString(buf, "add leaf to page");
|
appendStringInfo(buf, "off: %u, headoff: %u, parentoff: %u, nodeI: %u",
|
||||||
appendStringInfo(buf, "; off %u; headoff %u; parentoff %u",
|
|
||||||
xlrec->offnumLeaf, xlrec->offnumHeadLeaf,
|
xlrec->offnumLeaf, xlrec->offnumHeadLeaf,
|
||||||
xlrec->offnumParent);
|
xlrec->offnumParent, xlrec->nodeI);
|
||||||
if (xlrec->newPage)
|
if (xlrec->newPage)
|
||||||
appendStringInfoString(buf, " (newpage)");
|
appendStringInfoString(buf, " (newpage)");
|
||||||
if (xlrec->storesNulls)
|
if (xlrec->storesNulls)
|
||||||
@ -39,42 +38,91 @@ spg_desc(StringInfo buf, XLogReaderState *record)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XLOG_SPGIST_MOVE_LEAFS:
|
case XLOG_SPGIST_MOVE_LEAFS:
|
||||||
appendStringInfo(buf, "%u leafs",
|
{
|
||||||
((spgxlogMoveLeafs *) rec)->nMoves);
|
spgxlogMoveLeafs *xlrec = (spgxlogMoveLeafs *) rec;
|
||||||
|
|
||||||
|
appendStringInfo(buf, "nmoves: %u, parentoff: %u, nodeI: %u",
|
||||||
|
xlrec->nMoves,
|
||||||
|
xlrec->offnumParent, xlrec->nodeI);
|
||||||
|
if (xlrec->newPage)
|
||||||
|
appendStringInfoString(buf, " (newpage)");
|
||||||
|
if (xlrec->replaceDead)
|
||||||
|
appendStringInfoString(buf, " (replacedead)");
|
||||||
|
if (xlrec->storesNulls)
|
||||||
|
appendStringInfoString(buf, " (nulls)");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case XLOG_SPGIST_ADD_NODE:
|
case XLOG_SPGIST_ADD_NODE:
|
||||||
appendStringInfo(buf, "off %u",
|
{
|
||||||
((spgxlogAddNode *) rec)->offnum);
|
spgxlogAddNode *xlrec = (spgxlogAddNode *) rec;
|
||||||
|
|
||||||
|
appendStringInfo(buf, "off: %u, newoff: %u, parentBlk: %d, "
|
||||||
|
"parentoff: %u, nodeI: %u",
|
||||||
|
xlrec->offnum,
|
||||||
|
xlrec->offnumNew,
|
||||||
|
xlrec->parentBlk,
|
||||||
|
xlrec->offnumParent,
|
||||||
|
xlrec->nodeI);
|
||||||
|
if (xlrec->newPage)
|
||||||
|
appendStringInfoString(buf, " (newpage)");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case XLOG_SPGIST_SPLIT_TUPLE:
|
case XLOG_SPGIST_SPLIT_TUPLE:
|
||||||
appendStringInfo(buf, "prefix off: %u, postfix off: %u (same %d, new %d)",
|
{
|
||||||
((spgxlogSplitTuple *) rec)->offnumPrefix,
|
spgxlogSplitTuple *xlrec = (spgxlogSplitTuple *) rec;
|
||||||
((spgxlogSplitTuple *) rec)->offnumPostfix,
|
|
||||||
((spgxlogSplitTuple *) rec)->postfixBlkSame,
|
appendStringInfo(buf, "prefixoff: %u, postfixoff: %u",
|
||||||
((spgxlogSplitTuple *) rec)->newPage
|
xlrec->offnumPrefix,
|
||||||
);
|
xlrec->offnumPostfix);
|
||||||
|
if (xlrec->newPage)
|
||||||
|
appendStringInfoString(buf, " (newpage)");
|
||||||
|
if (xlrec->postfixBlkSame)
|
||||||
|
appendStringInfoString(buf, " (same)");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case XLOG_SPGIST_PICKSPLIT:
|
case XLOG_SPGIST_PICKSPLIT:
|
||||||
{
|
{
|
||||||
spgxlogPickSplit *xlrec = (spgxlogPickSplit *) rec;
|
spgxlogPickSplit *xlrec = (spgxlogPickSplit *) rec;
|
||||||
|
|
||||||
appendStringInfo(buf, "ndel %u; nins %u",
|
appendStringInfo(buf, "ndelete: %u, ninsert: %u, inneroff: %u, "
|
||||||
xlrec->nDelete, xlrec->nInsert);
|
"parentoff: %u, nodeI: %u",
|
||||||
|
xlrec->nDelete, xlrec->nInsert,
|
||||||
|
xlrec->offnumInner,
|
||||||
|
xlrec->offnumParent, xlrec->nodeI);
|
||||||
if (xlrec->innerIsParent)
|
if (xlrec->innerIsParent)
|
||||||
appendStringInfoString(buf, " (innerIsParent)");
|
appendStringInfoString(buf, " (innerIsParent)");
|
||||||
|
if (xlrec->storesNulls)
|
||||||
|
appendStringInfoString(buf, " (nulls)");
|
||||||
if (xlrec->isRootSplit)
|
if (xlrec->isRootSplit)
|
||||||
appendStringInfoString(buf, " (isRootSplit)");
|
appendStringInfoString(buf, " (isRootSplit)");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XLOG_SPGIST_VACUUM_LEAF:
|
case XLOG_SPGIST_VACUUM_LEAF:
|
||||||
/* no further information */
|
{
|
||||||
|
spgxlogVacuumLeaf *xlrec = (spgxlogVacuumLeaf *) rec;
|
||||||
|
|
||||||
|
appendStringInfo(buf, "ndead: %u, nplaceholder: %u, nmove: %u, nchain: %u",
|
||||||
|
xlrec->nDead, xlrec->nPlaceholder,
|
||||||
|
xlrec->nMove, xlrec->nChain);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case XLOG_SPGIST_VACUUM_ROOT:
|
case XLOG_SPGIST_VACUUM_ROOT:
|
||||||
/* no further information */
|
{
|
||||||
|
spgxlogVacuumRoot *xlrec = (spgxlogVacuumRoot *) rec;
|
||||||
|
|
||||||
|
appendStringInfo(buf, "ndelete: %u",
|
||||||
|
xlrec->nDelete);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case XLOG_SPGIST_VACUUM_REDIRECT:
|
case XLOG_SPGIST_VACUUM_REDIRECT:
|
||||||
appendStringInfo(buf, "newest XID %u",
|
{
|
||||||
((spgxlogVacuumRedirect *) rec)->newestRedirectXid);
|
spgxlogVacuumRedirect *xlrec = (spgxlogVacuumRedirect *) rec;
|
||||||
|
|
||||||
|
appendStringInfo(buf, "ntoplaceholder: %u, firstplaceholder: %u, newestredirectxid: %u",
|
||||||
|
xlrec->nToPlaceholder,
|
||||||
|
xlrec->firstPlaceholder,
|
||||||
|
xlrec->newestRedirectXid);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user