Re: Cache relation sizes?
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Konstantin Knizhnik <k.knizhnik@postgrespro.ru>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-11-17T09:49:38Z
Lists: pgsql-hackers
On Tue, Nov 17, 2020 at 4:13 AM Thomas Munro <thomas.munro@gmail.com> wrote: > > On Mon, Nov 16, 2020 at 11:01 PM Konstantin Knizhnik > <k.knizhnik@postgrespro.ru> wrote: > > I will look at your implementation more precisely latter. > > Thanks! Warning: I thought about making a thing like this for a > while, but the patch itself is only a one-day prototype, so I am sure > you can find many bugs... Hmm, I guess the smgrnblocks_fast() code > really needs a nice big comment to explain the theory about why this > value is fresh enough, based on earlier ideas about implicit memory > barriers. (Something like: if you're extending, you must have > acquired the extension lock; if you're scanning you must have acquired > a snapshot that only needs to see blocks that existed at that time and > concurrent truncations are impossible; I'm wondering about special > snapshots like VACUUM, and whether this is too relaxed for that, or if > it's covered by existing horizon-based interlocking...). > Yeah, it is good to verify VACUUM stuff but I have another question here. What about queries having functions that access the same relation (SELECT c1 FROM t1 WHERE c1 <= func(); assuming here function access the relation t1)? Now, here I think because the relation 't1' is already opened, it might use the same value of blocks from the shared cache even though the snapshot for relation 't1' when accessed from func() might be different. Am, I missing something, or is it dealt in some way? -- With Regards, Amit Kapila.
Commits
-
Optimize DropRelFileNodesAllBuffers() for recovery.
- bea449c635c0 14.0 cited
-
Cache smgrnblocks() results in recovery.
- c5315f4f4484 14.0 landed
-
Use pg_pread() and pg_pwrite() for data files and WAL.
- c24dcd0cfd94 12.0 cited
-
Add a check to prevent overwriting valid data if smgrnblocks() gives a
- ffae5cc5a602 8.2.0 cited