Re: texteq/byteaeq: avoid detoast [REVIEW]
Martijn van Oosterhout <kleptog@svana.org>
From: Martijn van Oosterhout <kleptog@svana.org>
To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Peter Eisentraut <peter_e@gmx.net>, Magnus Hagander <magnus@hagander.net>, Itagaki Takahiro <itagaki.takahiro@gmail.com>, Andy Colson <andy@squeakycode.net>, Noah Misch <noah@leadboat.com>, pgsql-hackers@postgresql.org
Date: 2011-01-19T08:22:41Z
Lists: pgsql-hackers
On Tue, Jan 18, 2011 at 10:03:01AM +0200, Heikki Linnakangas wrote: >> That isn't ever going to happen, unless you'd like to give up hash joins >> and hash aggregation on text values. > > You could canonicalize the string first in the hash function. I'm not > sure if we have all the necessary information at hand there, but at > least with some encoding/locale-specific support functions it'd be > possible. This is what strxfrm() was created for. strcoll(a,b) == strcmp(strxfrm(a),strxfrm(b)) Sure there's a cost, the question is only how much and whether it makes hash join unfeasible. I doubt it, since by definition it must be faster than strcoll(). I suppose a test would be interesting. Have a nice day, -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > Patriotism is when love of your own people comes first; nationalism, > when hate for people other than your own comes first. > - Charles de Gaulle