Re: [PATCH] SortSupport for macaddr type

From: Brandur <brandur(at)mutelight(dot)org>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] SortSupport for macaddr type
Date: 2016-08-26 17:54:52
Message-ID: 20160826175452.GA65094@st-brandur1.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

And here's a commitfest link:

https://commitfest.postgresql.org/10/743/

Also, a correction to my original message: the unreferenced [1] footnote
points back to the thread that included the patch for UUID SortSupport.

[1] https://www.postgresql.org/message-id/CAM3SWZR4avsTwwNVUzRNbHk8v36W-QBqpoKg=OGkWWy0dKtWBA@mail.gmail.com

On Fri, Aug 26, 2016 at 10:44:22AM -0700, Brandur wrote:
> Hello,
>
> I've attached a patch to add SortSupport for Postgres' macaddr which has the
> effect of improving the performance of sorting operations for the type. The
> strategy that I employ is very similar to that for UUID, which is to create
> abbreviated keys by packing as many bytes from the MAC address as possible into
> Datums, and then performing fast unsigned integer comparisons while sorting.
>
> I ran some informal local benchmarks, and for cardinality greater than 100k
> rows, I see a speed up on `CREATE INDEX` of roughly 25% to 65%. (For those
> interested, I put a few more numbers into a small report here [2].)
>
> Admittedly, this is not quite as useful as speeding up sorting on a more common
> data type like TEXT or UUID, but the change still seems like a useful
> performance improvement. I largely wrote it as an exercise to familiarize
> myself with the Postgres codebase.
>
> I'll add an entry into the current commitfest as suggested by the Postgres Wiki
> and follow up here with a link.
>
> Thanks, and if anyone has feedback or other thoughts, let me know!
>
> Brandur
>
> [1] https://www.postgresql.org/message-id/CAM3SWZR4avsTwwNVUzRNbHk8v36W-QBqpoKg=OGkWWy0dKtWBA@mail.gmail.com
> [2] https://docs.google.com/spreadsheets/d/1cUqbg9RTgSo16WrrfJJwDP1eDaWL3TNOxnIOFNpfwgA/edit?usp=sharing

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-08-26 18:03:56 Re: PG_DIAG_SEVERITY and a possible bug in pq_parse_errornotice()
Previous Message Brandur 2016-08-26 17:44:22 [PATCH] SortSupport for macaddr type