diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-01-24 07:16:52 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-01-24 07:16:52 +0000 |
commit | 0dbffa704ab3235431b4caef675d9179109d4a0c (patch) | |
tree | e00f27de3b6a2faec151f4d2d6aa924ba05d5e5d /src/tutorial/complex.source | |
parent | 8bcac56086ec1aa1eae04879bfb22275b9396522 (diff) | |
download | postgresql-0dbffa704ab3235431b4caef675d9179109d4a0c.tar.gz postgresql-0dbffa704ab3235431b4caef675d9179109d4a0c.zip |
First cut at making useful selectivity estimates for range queries
(ie, WHERE x > lowbound AND x < highbound). It's not very bright yet
but it does something useful. Also, rename intltsel/intgtsel to
scalarltsel/scalargtsel to reflect usage better. Extend convert_to_scalar
to do something a little bit useful with string data types. Still need
to make it do something with date/time datatypes, but I'll wait for
Thomas's datetime unification dust to settle first. Eventually the
routine ought not have any type-specific knowledge at all; it ought to
be calling a type-dependent routine found via a pg_type column; but
that's a task for another day.
Diffstat (limited to 'src/tutorial/complex.source')
-rw-r--r-- | src/tutorial/complex.source | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/tutorial/complex.source b/src/tutorial/complex.source index 847ec1a2188..bc71e34c9ed 100644 --- a/src/tutorial/complex.source +++ b/src/tutorial/complex.source @@ -7,7 +7,7 @@ -- -- Copyright (c) 1994, Regents of the University of California -- --- $Id: complex.source,v 1.5 2000/01/22 23:50:30 tgl Exp $ +-- $Id: complex.source,v 1.6 2000/01/24 07:16:48 tgl Exp $ -- --------------------------------------------------------------------------- @@ -148,15 +148,13 @@ CREATE FUNCTION complex_abs_ge(complex, complex) RETURNS bool CREATE FUNCTION complex_abs_gt(complex, complex) RETURNS bool AS '_OBJWD_/complex.so' LANGUAGE 'c'; --- the restrict and join selectivity functions are bogus (notice we only --- have intltsel, eqsel and intgtsel) CREATE OPERATOR < ( leftarg = complex, rightarg = complex, procedure = complex_abs_lt, - restrict = intltsel, join = intltjoinsel + restrict = scalarltsel, join = scalarltjoinsel ); CREATE OPERATOR <= ( leftarg = complex, rightarg = complex, procedure = complex_abs_le, - restrict = intltsel, join = intltjoinsel + restrict = scalarltsel, join = scalarltjoinsel ); CREATE OPERATOR = ( leftarg = complex, rightarg = complex, procedure = complex_abs_eq, @@ -164,11 +162,11 @@ CREATE OPERATOR = ( ); CREATE OPERATOR >= ( leftarg = complex, rightarg = complex, procedure = complex_abs_ge, - restrict = intgtsel, join = intgtjoinsel + restrict = scalargtsel, join = scalargtjoinsel ); CREATE OPERATOR > ( leftarg = complex, rightarg = complex, procedure = complex_abs_gt, - restrict = intgtsel, join = intgtjoinsel + restrict = scalargtsel, join = scalargtjoinsel ); INSERT INTO pg_opclass VALUES ('complex_abs_ops'); |