On Fri, Nov 12, 2010 at 03:05, Tom Lane <t...@sss.pgh.pa.us> wrote: > "David E. Wheeler" <da...@kineticode.com> writes: >> So are you planning to implement multisets? It's a feature I'd love to see > > What actual functionality does it buy? AFAICT from Itagaki-san's > description, it's an array only you ignore the specific element order. > So what? You can write functions that work that way now.
I think there are almost no difference between a multiset and an array in terms of functions I described in the first mail. However, if we have separated multiset data type, we could have special comparison operators for them; "array = array" returns true only if they have the same elements in the same order, but "multiset = multiset" only checks elements in them. Also, we could optimize on-disk structure of multiset for fast UNION operations or for dataset that has many duplicates. For example, we could use a sorted array of {value, count} pairs. If we decide to have data type IDs for multiset, I'll go for it (ex. int4, _int4, and an additional $int4), but it consumes +50% of typoids. If it is not preferable, only function support might be better at the first try. -- Itagaki Takahiro -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers