Re: MULTISET and additional functions for ARRAY
От | Itagaki Takahiro |
---|---|
Тема | Re: MULTISET and additional functions for ARRAY |
Дата | |
Msg-id | AANLkTiny1u+UYVMJ6--44zsGEfj_qPqiRcifocoJ5ef+@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: MULTISET and additional functions for ARRAY (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
On Fri, Nov 12, 2010 at 03:05, Tom Lane <tgl@sss.pgh.pa.us> wrote: > "David E. Wheeler" <david@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
В списке pgsql-hackers по дате отправления: