Text Selectivity Operators in String Types

Started by David E. Wheelerover 17 years ago3 messageshackers
Jump to latest
#1David E. Wheeler
david@kineticode.com

Howdy,

A while back, thanks to feedback from RhodiumToad on #postgresql, I
added selectivity functions to the citext operators:

CREATE OPERATOR = (
LEFTARG = CITEXT,
RIGHTARG = CITEXT,
COMMUTATOR = =,
NEGATOR = <>,
PROCEDURE = citext_eq,
RESTRICT = eqsel,
JOIN = eqjoinsel,
HASHES,
MERGES
);

However, it looks like these might be less than ideal:

http://www.depesz.com/index.php/2008/08/10/waiting-for-84-case-insensitive-text-citext/

From what depesz sees, the eqsel and eqjoinsel functions might be a
bit too aggressive in recommending the use of indexes.

So I was wondering, since in CVS HEAD citext is able to identify its
type category as string, might there also be some way to use the same
estimator functions in the citext operators as are used for text?

Thanks,

David

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: David E. Wheeler (#1)
Re: Text Selectivity Operators in String Types

"David E. Wheeler" <david@kineticode.com> writes:

From what depesz sees, the eqsel and eqjoinsel functions might be a
bit too aggressive in recommending the use of indexes.

He presented absolutely 0 evidence to back up that opinion.

So I was wondering, since in CVS HEAD citext is able to identify its
type category as string, might there also be some way to use the same
estimator functions in the citext operators as are used for text?

Those are the same estimator functions.

regards, tom lane

#3David E. Wheeler
david@kineticode.com
In reply to: Tom Lane (#2)
Re: Text Selectivity Operators in String Types

On Aug 18, 2008, at 12:18, Tom Lane wrote:

"David E. Wheeler" <david@kineticode.com> writes:

From what depesz sees, the eqsel and eqjoinsel functions might be a
bit too aggressive in recommending the use of indexes.

He presented absolutely 0 evidence to back up that opinion.

So I was wondering, since in CVS HEAD citext is able to identify its
type category as string, might there also be some way to use the same
estimator functions in the citext operators as are used for text?

Those are the same estimator functions.

Oh. Okay then. That was easy. Thanks!

Best,

David