Another hstore_type idea - Mailing list pgsql-hackers

From Marc Mamin
Subject Another hstore_type idea
Date
Msg-id C4DAC901169B624F933534A26ED7DF310861B269@JENMAIL01.ad.intershop.net
Whole thread Raw
Responses Re: Another hstore_type idea
List pgsql-hackers
<p dir="LTR"><span lang="de"></span><span lang="en-us"><font face="Calibri">Hello,</font></span><p dir="LTR"><span
lang="en-us"><fontface="Calibri">after reading the thread on "Typed hstore proposal", I wonder if another minded
extensionof hstore would be benefical:</font></span><p dir="LTR"><span lang="en-us"><font face="Calibri">add additional
hstoretypes with numerical data type for the values.</font></span><p dir="LTR"><span lang="de"></span><span
lang="en-us"><fontface="Calibri">e.g.</font></span><span lang="de"></span><span lang="en-us"><font
face="Calibri">:</font></span><spanlang="de"></span><span lang="en-us"> <font face="Calibri"> hstore_float : text ->
float</font></span><pdir="LTR"><span lang="de"></span><span lang="en-us"></span><p dir="LTR"><span lang="en-us"><font
face="Calibri">Thisshould allow to add some nice aggregation function on these hstore, e.g.</font></span><p
dir="LTR"><spanlang="en-us"><font face="Calibri">select distinct_sum(x) from</font></span><p dir="LTR"><span
lang="en-us"><fontface="Calibri">(</font></span><p dir="LTR"><span lang="en-us"><font face="Calibri">  a -> 1   b
->5</font></span><p dir="LTR"><span lang="en-us"><font face="Calibri">  a -> 3   c -> 2</font></span><p
dir="LTR"><spanlang="en-us"><font face="Calibri">)</font></span><p dir="LTR"><span lang="en-us"><font
face="Calibri">=></font></span><pdir="LTR"><span lang="en-us"><font face="Calibri">a -> 4  b -> 5  c ->
2</font></span><br/><p dir="LTR"><span lang="en-us"><font face="Calibri">I have a small case where I'm doing this with
acustom type (text, float) , but with poor performances.</font></span><p dir="LTR"><span lang="en-us"><font
face="Calibri">Iguess that such an extension would make sense if it were to bring a significant performance gain
comparedto the custom type approach.</font></span><p dir="LTR"><span lang="en-us"><font face="Calibri">best regards and
MerryChristmas,</font></span><p dir="LTR"><span lang="de"><font face="Calibri">Marc Mamin</font></span><span
lang="de"></span>

pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: xlog location arithmetic
Next
From: Robert Haas
Date:
Subject: Re: Moving more work outside WALInsertLock