Re: Memory-comparable Serialization of Data Types

From: Shichao Jin <jsc0218(at)gmail(dot)com>
To: Peter Geoghegan <pg(at)bowt(dot)ie>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Memory-comparable Serialization of Data Types
Date: 2020-02-12 15:41:26
Message-ID: CABCoBcKoSeTe=Rbqq5BZruPa6SYLdZVhJciDKtSBOUtzo+2cKw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thank you for both your feedback. Yes, as indicated by Peter, we indeed use
that technique in comparison in index, and now we will try passing
comparator to the storage engine according to Alvaro's suggestion.

Best,
Shichao

On Tue, 11 Feb 2020 at 17:16, Peter Geoghegan <pg(at)bowt(dot)ie> wrote:

> On Tue, Feb 11, 2020 at 1:40 PM Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
> wrote:
> > I think adding that would be too much of a burden, both for the project
> > itself as for third-party type definitions; I think we'd rather rely on
> > calling the BTORDER_PROC btree support function for the type.
>
> An operator class would still need to provide a BTORDER_PROC. What I
> describe would be an optional capability. This is something that I
> have referred to as key normalization in the past:
>
> https://wiki.postgresql.org/wiki/Key_normalization
>
> I think that it would only make sense as an enabler of multiple
> optimizations -- not just the memcmp()/strcmp() thing. A common
> strcmp()'able binary string format can be used in many different ways.
> Note that this has nothing to do with changing the representation used
> by the vast majority of all tuples -- just the pivot tuples, which are
> mostly located in internal pages. They only make up less than 1% of
> all pages in almost all cases.
>
> I intend to prototype this technique within the next year. It's
> possible that it isn't worth the trouble, but there is only one way to
> find out. I might just work on the "abbreviated keys in internal
> pages" thing, for example. Though you really need some kind of prefix
> compression to make that effective.
>
> --
> Peter Geoghegan
>

--
Shichao Jin
PhD Student at University of Waterloo, Canada
e-mail: jsc0218(at)gmail(dot)com
homepage: http://sites.google.com/site/csshichaojin/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2020-02-12 16:17:30 Updating row and width estimates in postgres_fdw
Previous Message Peter Eisentraut 2020-02-12 15:00:14 Support external parameters in EXECUTE command