Re: range_agg - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: range_agg
Date
Msg-id 20200304213321.GA23016@alvherre.pgsql
Whole thread Raw
In response to Re: range_agg  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: range_agg  (Paul Jungwirth <pj@illuminatedcomputing.com>)
List pgsql-hackers
I came across an interesting thing, namely multirange_canonicalize()'s
use of qsort_arg with a callback of range_compare().  range_compare()
calls range_deserialize() (non-trivial parsing) for each input range;
multirange_canonicalize() later does a few extra deserialize calls of
its own.  Call me a premature optimization guy if you will, but I think
it makes sense to have a different struct (let's call it
"InMemoryRange") which stores the parsed representation of each range;
then we can deserialize all ranges up front, and use that as many times
as needed, without having to deserialize each range every time.

While I'm at this, why not name the new file simply multiranges.c
instead of multirangetypes.c?

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Setting ACL
Next
From: Justin Pryzby
Date:
Subject: Re: error context for vacuum to include block number