RE: [Patch] Optimize dropping of relation buffers using dlist - Mailing list pgsql-hackers

From tsunakawa.takay@fujitsu.com
Subject RE: [Patch] Optimize dropping of relation buffers using dlist
Date
Msg-id TYAPR01MB2990CF06E88342854CF3DB6CFE140@TYAPR01MB2990.jpnprd01.prod.outlook.com
Whole thread Raw
In response to RE: [Patch] Optimize dropping of relation buffers using dlist  ("k.jamison@fujitsu.com" <k.jamison@fujitsu.com>)
Responses RE: [Patch] Optimize dropping of relation buffers using dlist
List pgsql-hackers
The patch looks almost good except for the minor ones:

(1)
+    for (i = 0; i < nnodes; i++)
+    {
+        RelFileNodeBackend rnode = smgr_reln[i]->smgr_rnode;
+
+        rnodes[i] = rnode;
+    }

You can write:

+    for (i = 0; i < nnodes; i++)
+        rnodes[i] = smgr_reln[i]->smgr_rnode;


(2)
+        if (!accurate || j >= MAX_FORKNUM ||

The correct condition would be:

+        if (j <= MAX_FORKNUM ||

because j becomes MAX_FORKNUM + 1 if accurate sizes for all forks could be obtained.  If any fork's size is inaccurate,
jis <= MAX_FORKNUM when exiting the loop, so you don't need to test for accurate flag.
 


(3)
+        {
+            goto buffer_full_scan;
+            return;
+        }

return after goto cannot be reached, so this should just be:

+            goto buffer_full_scan;



Regards
Takayuki Tsunakawa


pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Add important info about ANALYZE after create Functional Index
Next
From: Andres Freund
Date:
Subject: Re: recovering from "found xmin ... from before relfrozenxid ..."