8000 Remove redundant incomplete split assertion. · postgres/postgres@fc31001 · GitHub
[go: up one dir, main page]

Skip to content
{"payload":{"commit":{"oid":"fc3100112395485f1c65848b273b3235de4aad07","url":"/postgres/postgres/commit/fc3100112395485f1c65848b273b3235de4aad07","authoredDate":"2020-01-05T17:42:13.000-08:00","committedDate":"2020-01-05T17:42:13.000-08:00","shortMessage":null,"shortMessageMarkdown":"\u003cdiv\u003eRemove redundant incomplete split assertion.\u003c/div\u003e","shortMessageMarkdownLink":null,"bodyMessageHtml":"The fastpath insert optimization's incomplete split flag Assert() is\nredundant. We'll reach the more general Assert() within\n_bt_findinsertloc() in all cases. (Besides, Assert()'ing that the\nrightmost page doesn't have the flag set never made much sense.)","authors":[{"login":"petergeoghegan","displayName":"Peter Geoghegan","avatarUrl":"https://avatars.githubusercontent.com/u/779307?v=4","path":"/petergeoghegan","isGitHub":false}],"committerAttribution":false,"committer":{"login":"petergeoghegan","displayName":"Peter Geoghegan","avatarUrl":"https://avatars.githubusercontent.com/u/779307?v=4","path":"/petergeoghegan","isGitHub":false},"parents":["8c081a2f4e8eec11747e709c1ea4c3485ef129dd"],"globalRelayId":"MDY6Q29tbWl0OTI3NDQyOmZjMzEwMDExMjM5NTQ4NWYxYzY1ODQ4YjI3M2IzMjM1ZGU0YWFkMDc=","sha1":"8c081a2f4e8eec11747e709c1ea4c3485ef129dd","sha2":"fc3100112395485f1c65848b273b3235de4aad07"},"currentUser":null,"repo":{"id":927442,"defaultBranch":"master","name":"postgres","ownerLogin":"postgres","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2010-09-21T11:35:45.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/177543?v=4","public":true,"private":false,"isOrgOwned":true},"diffEntryData":[{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":178,"text":"@@ -179,11 +179,6 @@ _bt_doinsert(Relation rel, IndexTuple itup,","html":"@@ -179,11 +179,6 @@ _bt_doinsert(Relation rel, IndexTuple itup,","displayNoNewLineWarning":false,"position":0,"left":178,"right":178},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":179,"text":" \t\t\t\tPageGetMaxOffsetNumber(page) \u003e= P_FIRSTDATAKEY(lpageop) \u0026\u0026","html":" \t\t\t\t\u003cspan class=pl-en\u003ePageGetMaxOffsetNumber\u003c/span\u003e(\u003cspan class=pl-s1\u003epage\u003c/span\u003e) \u0026gt;= \u003cspan class=pl-en\u003eP_FIRSTDATAKEY\u003c/span\u003e(\u003cspan class=pl-s1\u003elpageop\u003c/span\u003e) \u003cspan class=pl-c1\u003e\u0026amp;\u0026amp;\u003c/span\u003e","displayNoNewLineWarning":false,"position":1,"left":179,"right":179},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":180,"text":" \t\t\t\t_bt_compare(rel, itup_key, page, P_FIRSTDATAKEY(lpageop)) \u003e 0)","html":" \t\t\t\t\u003cspan class=pl-en\u003e_bt_compare\u003c/span\u003e(\u003cspan class=pl-s1\u003erel\u003c/span\u003e, \u003cspan class=pl-s1\u003eitup_key\u003c/span\u003e, \u003cspan class=pl-s1\u003epage\u003c/span\u003e, \u003cspan class=pl-en\u003eP_FIRSTDATAKEY\u003c/span\u003e(\u003cspan class=pl-s1\u003elpageop\u003c/span\u003e)) \u003cspan class=pl-c1\u003e\u0026gt;\u003c/span\u003e \u003cspan class=pl-c1\u003e0\u003c/span\u003e)","displayNoNewLineWarning":false,"position":2,"left":180,"right":180},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":181,"text":" \t\t\t{","html":" \t\t\t{","displayNoNewLineWarning":false,"position":3,"left":181,"right":181},{"stylingDirective":null,"type":"DELETION","blobLineNumber":182,"text":"-\t\t\t\t/*","html":"-\t\t\t\t\u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":4,"left":182,"right":181},{"stylingDirective":null,"type":"DELETION","blobLineNumber":183,"text":"-\t\t\t\t * The right-most block should never have an incomplete split.","html":"-\u003cspan class=pl-c\u003e\t\t\t\t * The right-most block should never have an incomplete split.\u003c/span\u003e","displayNoNewLineWarning":false,"position":5,"left":183,"right":181},{"stylingDirective":null,"type":"DELETION","blobLineNumber":184,"text":"-\t\t\t\t * But be paranoid and check for it anyway.","html":"-\u003cspan class=pl-c\u003e\t\t\t\t * But be paranoid and check for it anyway.\u003c/span\u003e","displayNoNewLineWarning":false,"position":6,"left":184,"right":181},{"stylingDirective":null,"type":"DELETION","blobLineNumber":185,"text":"-\t\t\t\t */","html":"-\u003cspan class=pl-c\u003e\t\t\t\t */\u003c/span\u003e","displayNoNewLineWarning":false,"position":7,"left":185,"right":181},{"stylingDirective":null,"type":"DELETION","blobLineNumber":186,"text":"-\t\t\t\tAssert(!P_INCOMPLETE_SPLIT(lpageop));","html":"-\t\t\t\t\u003cspan class=pl-en\u003eAssert\u003c/span\u003e(!\u003cspan class=pl-en\u003eP_INCOMPLETE_SPLIT\u003c/span\u003e(\u003cspan class=pl-s1\u003elpageop\u003c/span\u003e));","displayNoNewLineWarning":false,"position":8,"left":186,"right":181},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":182,"text":" \t\t\t\tfastpath = true;","html":" \t\t\t\t\u003cspan class=pl-s1\u003efastpath\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e true;","displayNoNewLineWarning":false,"position":9,"left":187,"right":182},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":183,"text":" \t\t\t}","html":" \t\t\t}","displayNoNewLineWarning":false,"position":10,"left":188,"right":183},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":184,"text":" \t\t\telse","html":" \t\t\t\u003cspan class=pl-k\u003eelse\u003c/span\u003e","displayNoNewLineWarning":false,"position":11,"left":189,"right":184}],"diffNumber":0,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":2303,"linesChanged":5,"newTreeEntry":{"lineCount":2303,"path":"src/backend/access/nbtree/nbtinsert.c","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"src/backend/access/nbtree/nbtinsert.c","mode":100644},"linesAdded":0,"linesDeleted":5,"path":"src/backend/access/nbtree/nbtinsert.c","pathDigest":"11092c6fe19a320b93b5e4854f3f63503d7cadbeef4ee4c8cabdba20a3303073","status":"MODIFIED","truncatedReason":null,"oldOid":"8c081a2f4e8eec11747e709c1ea4c3485ef129dd","newOid":"fc3100112395485f1c65848b273b3235de4aad07","copilotChatReference":null,"deletedSha":"8c081a2f4e8eec11747e709c1ea4c3485ef129dd","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null}],"splitViewPreference":"unified","ignoreWhitespace":false,"repoOwnerGlobalRelayId":"MDEyOk9yZ2FuaXphdGlvbjE3NzU0Mw==","commentsPreference":"visible","diffLineSpacingPreference":"relaxed","useMonospaceFont":false,"pasteUrlLinkAsPlainText":false,"userNotices":[],"path":"/postgres/postgres/commit/fc3100112395485f1c65848b273b3235de4aad07","fileTreeExpanded":true,"headerInfo":{"additions":0,"deletions":5,"filesChanged":1,"filesChangedString":"1"},"moreDiffsToLoad":false,"asyncDiffLoadInfo":{"startIndex":1,"truncated":false,"byteCount":416,"lineShownCount":12},"commentInfo":{"canComment":false,"locked":false,"canLock":false,"repoArchived":false},"csrf_tokens":{"/users/diffview?diff=split":{"post":"DYZuO7-EK80RsJrymWP6z5mL3QVdkYiR6MC14Pg2JDJFHXkJNqLpzT9vaYHwsYaKjK3IahcLa1gEWvZn0JpfVA"},"/users/diffview?diff=unified":{"post":"BjXDOk9ej8Mhf_OcJugv3-WTByUKkmzIrm0quRsR6blOrtQIxnhNww-gAO9POlOa8LUSSkAIjwFC92k-M72S3w"},"/notifications/thread":{"post":"9snj6tAW29BNRL8ZZ4FshjSL8h0hP03sl9R-RbTrCiBtxyboXYKHe5kNNREG-vusN90Qc8xFKQWpsVl5XdjB5A"}}},"title":"Remove redundant incomplete split assertion. · postgres/postgres@fc31001","appPayload":{"helpUrl":"https://docs.github.com","findInDiffWorkerPath":"/assets-cdn/worker/find-in-diff-worker-2bfe39677d14.js","enabled_features":{"diff_ux_refresh_beta":false,"diff_inline_comments":true,"diff_ux_refresh_ssr_five":false,"diff_ux_refresh_ssr_ten":false,"react_diff_line_type_character_correction":true}}}

Commit fc31001

Browse files
Remove redundant incomplete split assertion.
The fastpath insert optimization's incomplete split flag Assert() is redundant. We'll reach the more general Assert() within _bt_findinsertloc() in all cases. (Besides, Assert()'ing that the rightmost page doesn't have the flag set never made much sense.)
1 parent 8c081a2 commit fc31001

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

src/backend/access/nbtree/nbtinsert.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,6 @@ _bt_doinsert(Relation rel, IndexTuple itup,
179179
PageGetMaxOffsetNumber(page) >= P_FIRSTDATAKEY(lpageop) &&
180180
_bt_compare(rel, itup_key, page, P_FIRSTDATAKEY(lpageop)) > 0)
181181
{
182-
/*
183-
* The right-most block should never have an incomplete split.
184-
* But be paranoid and check for it anyway.
185-
*/
186-
Assert(!P_INCOMPLETE_SPLIT(lpageop));
187182
fastpath = true;
188183
}
189184
else

0 commit comments

Comments
 (0)
0