Re: Patch: Write Amplification Reduction Method (WARM)
Pavan Deolasee <pavan.deolasee@gmail.com>
From: Pavan Deolasee <pavan.deolasee@gmail.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Jaime Casanova <jaime.casanova@2ndquadrant.com>, Haribabu Kommi <kommi.haribabu@gmail.com>,
Tomas Vondra <tomas.vondra@2ndquadrant.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2017-01-31T14:04:36Z
Lists: pgsql-hackers
On Tue, Jan 31, 2017 at 7:21 PM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote: > Pavan Deolasee wrote: > > On Thu, Jan 26, 2017 at 2:38 AM, Alvaro Herrera < > alvherre@2ndquadrant.com> > > wrote: > > > > The simple_heap_update + CatalogUpdateIndexes pattern is getting > > > obnoxious. How about creating something like catalog_heap_update which > > > does both things at once, and stop bothering each callsite with the > WARM > > > stuff? > > > > What I realised that there are really 2 patterns: > > 1. simple_heap_insert, CatalogUpdateIndexes > > 2. simple_heap_update, CatalogUpdateIndexes > > > > There are only couple of places where we already have indexes open or > have > > more than one tuple to update, so we call CatalogIndexInsert directly. > What > > I ended up doing in the attached patch is add two new APIs which combines > > the two steps of each of these patterns. It seems much cleaner to me and > > also less buggy for future users. I hope I am not missing a reason not to > > do combine these steps. > > CatalogUpdateIndexes was just added as a convenience function on top of > a very common pattern. If we now have a reason to create a second one > because there are now two very common patterns, it seems reasonable to > have two functions. I think I would commit the refactoring to create > these functions ahead of the larger WARM patch, since I think it'd be > bulky and largely mechanical. (I'm going from this description; didn't > read your actual code.) > Sounds good. Should I submit that as a separate patch on current master? Thanks, Pavan -- Pavan Deolasee http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
Commits
-
Implement SortSupport for macaddr data type
- f90d23d0c518 10.0 cited
-
Simplify check of modified attributes in heap_update
- 2fd8685e7fd9 10.0 landed
-
Remove direct uses of ItemPointer.{ip_blkid,ip_posid}
- ce96ce60ca22 10.0 landed
-
Fix CatalogTupleInsert/Update abstraction for case of shared indstate.
- aedd554f84bb 10.0 landed
-
Provide CatalogTupleDelete() as a wrapper around simple_heap_delete().
- ab02896510e2 10.0 landed
-
Band-aid fix for incorrect use of view options as StdRdOptions.
- e3e66d8a9813 10.0 cited
-
Update visibility map in the second phase of vacuum.
- fdf9e21196a6 9.3.0 cited
-
Avoid having two copies of the HOT-chain search logic.
- 4da99ea4231e 9.2.0 cited
-
Postgres95 1.01 Distribution - Virgin Sources
- d31084e9d111 7.1.1 cited