Re: Patch: Write Amplification Reduction Method (WARM)

From: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Jaime Casanova <jaime(dot)casanova(at)2ndquadrant(dot)com>, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: Write Amplification Reduction Method (WARM)
Date: 2017-03-29 06:21:17
Message-ID: CABOikdNCx6Hh2u62+8W3Q_OEKYDbBMjwYG9vMpsZ=RPhPETDRw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

On Wed, Mar 29, 2017 at 3:42 AM, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
wrote:

> I pushed 0002 after some makeup, since it's just cosmetic and not
> controversial.

Thanks. I think your patch of tracking interesting attributes seems ok too
after the performance issue was addressed. Even though we can still improve
that further, at least Mithun confirmed that there is no significant
regression anymore and in fact for one artificial case, patch does better
than even master.

> Here's 0003 rebased on top of it.
>
> (Also, I took out the gin and gist changes: it would be wrong to change
> that unconditionally, because the 0xFFFF pattern appears in indexes that
> would be pg_upgraded. We need a different strategy, if we want to
> enable WARM on GiST/GIN indexes.)
>
>
Yeah, those changes would have broken pg-upgraded clusters. So looks good.
But the rebased patch throws an assertion failure.
ItemPointerGetOffsetNumberNoCheck will mask the first 3 bits and return the
rest, but since GIN continues to store ip_posid greater than
OffsetNumberMask, the masking causes problems. May be we can teach
GinItemPointerGetOffsetNumber to fetch the flags separately and add them
back to what ItemPointerGetOffsetNumberNoCheck returns. This avoids
referencing ip_posid directly from this code.

BTW we have messed up patch names a bit here. You applied 0003 from v21 and
rebased 0004. But the rebased patch was
named 0001-Free-3-bits-of-ItemPointerData.ip_posid.patch. I'm reverting
back to the earlier used names. So rebased v22 set of patches attached.

0001_interesting_attrs_v22.patch - Alvaro's patch of simplifying attr
checks. I think this has settled down

0002_track_root_lp_v22 - We probably need to decide whether its worth
saving a bit in tuple header for additional work during WARM update of
finding root tuple.

0004_Free-3-bits-of-ItemPointerData.ip_posid_v22 - A slight update to
Alvaro's rebased version posted yesterday

0005_warm_updates_v22 - Main WARM patch. Addresses all review comments so
far and includes fixes for toasted value handling

0007_vacuum_enhancements_v22 - VACUUM enhancements to control WARM cleanup.
This now also includes changes made to memory usage. The dead tuples and
warm chains are tracked in a single work area, from two ends. When these
ends meet, we do a round of index cleanup. IMO this should give us most
optimal utilisation of available memory depending on whether we are doing
WARM cleanup or not and percentage of dead tuples and warm chains.

0006_warm_taptests_v22 - Alvaro reported lack of Makefile. It also seemed
that he wants to rename it to avoid "warm" reference. So done that, but
Alvaro is seeing hangs with the tests in his environment, so probably needs
some investigation. It works for me with IPC::Run 0.94

Thanks,
Pavan

--
Pavan Deolasee http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
0006_warm_taptests_v22.patch application/octet-stream 20.1 KB
0007_vacuum_enhancements_v22.patch application/octet-stream 67.6 KB
0004_Free-3-bits-of-ItemPointerData.ip_posid_v22.patch application/octet-stream 3.6 KB
0002_track_root_lp_v22.patch application/octet-stream 38.4 KB
0001_interesting_attrs_v22.patch application/octet-stream 12.5 KB
0005_warm_updates_v22.patch application/octet-stream 275.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2017-03-29 06:22:31 Re: Patch: Write Amplification Reduction Method (WARM)
Previous Message Ashutosh Bapat 2017-03-29 06:20:48 Prologue of set_append_rel_size() and partitioned tables