Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
c3a4d8ed
Commit
c3a4d8ed
authored
May 20, 1999
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Very minor improvements in CREATE OPERATOR docs.
parent
c9f8ab6f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
14 deletions
+17
-14
doc/src/sgml/ref/create_operator.sgml
doc/src/sgml/ref/create_operator.sgml
+9
-8
src/man/create_operator.l
src/man/create_operator.l
+8
-6
No files found.
doc/src/sgml/ref/create_operator.sgml
View file @
c3a4d8ed
...
@@ -227,11 +227,11 @@ Operator that sorts the right-hand data type of this operator.
...
@@ -227,11 +227,11 @@ Operator that sorts the right-hand data type of this operator.
(either one or two).
(either one or two).
</para>
</para>
<para>
<para>
The
commutator operator is present so that
The
commutator operator should be identified if one exists,
<productname>Postgres</productname> can
so that
<productname>Postgres</productname> can
reverse the order of the operands if it wishes.
reverse the order of the operands if it wishes.
For example, the operator area-less-than, <<<,
For example, the operator area-less-than, <<<,
would have a commutator
would
probably
have a commutator
operator, area-greater-than, >>>.
operator, area-greater-than, >>>.
Hence, the query optimizer could freely convert:
Hence, the query optimizer could freely convert:
<programlisting>
<programlisting>
...
@@ -243,14 +243,15 @@ Operator that sorts the right-hand data type of this operator.
...
@@ -243,14 +243,15 @@ Operator that sorts the right-hand data type of this operator.
</para>
</para>
<para>
<para>
This allows the execution code to always use the latter
This allows the execution code to always use the latter
representation and simplifies the query optimizer some
representation and simplifies the query optimizer somewhat.
what.
</para>
</para>
<para>
<para>
Similarly, if there is a negator operator then it should be
identified.
Suppose that an
Suppose that an
operator, area-equal, ===, exists, as well as an area not
operator, area-equal, ===, exists, as well as an area not
equal, !==.
equal, !==.
The negator
operator allows the query optimizer to convert
The negator
link allows the query optimizer to simplify
<programlisting>
<programlisting>
NOT MYBOXES.description === "0,0,1,1"::box
NOT MYBOXES.description === "0,0,1,1"::box
</programlisting>
</programlisting>
...
@@ -325,8 +326,8 @@ Operator that sorts the right-hand data type of this operator.
...
@@ -325,8 +326,8 @@ Operator that sorts the right-hand data type of this operator.
satisfy the clause. The function
satisfy the clause. The function
<replaceable class="parameter">res_proc</replaceable>
<replaceable class="parameter">res_proc</replaceable>
must be a registered function (meaning it is already defined using
must be a registered function (meaning it is already defined using
define function(l)) which accepts one argument
of the correct
CREATE FUNCTION) which accepts arguments
of the correct
data type and returns a floating point number. The
data type
s
and returns a floating point number. The
query optimizer simply calls this function, passing the
query optimizer simply calls this function, passing the
parameter "0,0,1,1" and multiplies the result by the relation
parameter "0,0,1,1" and multiplies the result by the relation
size to get the desired expected number of instances.
size to get the desired expected number of instances.
...
...
src/man/create_operator.l
View file @
c3a4d8ed
.\" This is -*-nroff-*-
.\" This is -*-nroff-*-
.\" XXX standard disclaimer belongs here....
.\" XXX standard disclaimer belongs here....
.\" $Header: /cvsroot/pgsql/src/man/Attic/create_operator.l,v 1.
8 1999/04/15 00:09:00
tgl Exp $
.\" $Header: /cvsroot/pgsql/src/man/Attic/create_operator.l,v 1.
9 1999/05/20 03:21:02
tgl Exp $
.TH "CREATE OPERATOR" SQL 11/05/95 PostgreSQL PostgreSQL
.TH "CREATE OPERATOR" SQL 11/05/95 PostgreSQL PostgreSQL
.SH NAME
.SH NAME
create operator - define a new user operator
create operator - define a new user operator
...
@@ -88,9 +88,10 @@ and must have one or two arguments.
...
@@ -88,9 +88,10 @@ and must have one or two arguments.
.\" .(l
.\" .(l
.\" MYBOXES2.description A (\*(lq0,0,1,1\*(rq A MYBOXES.description).
.\" MYBOXES2.description A (\*(lq0,0,1,1\*(rq A MYBOXES.description).
.\" .)l
.\" .)l
The commutator operator is present so that Postgres can reverse the order
The commutator operator should be identified if one exists,
of the operands if it wishes. For example, the operator
so that Postgres can reverse the order of the operands if it wishes.
area-less-than, >>>, would have a commutator operator,
For example, the operator
area-less-than, >>>, would probably have a commutator operator,
area-greater-than, <<<. Hence, the query optimizer
area-greater-than, <<<. Hence, the query optimizer
could freely convert:
could freely convert:
.nf
.nf
...
@@ -109,9 +110,10 @@ MYBOXES.description <<< "0,0,1,1"::box
...
@@ -109,9 +110,10 @@ MYBOXES.description <<< "0,0,1,1"::box
This allows the execution code to always use the latter representation
This allows the execution code to always use the latter representation
and simplifies the query optimizer somewhat.
and simplifies the query optimizer somewhat.
.PP
.PP
Similarly, if there is a negator operator then it should be identified.
Suppose that an operator, area-equal, ===,
Suppose that an operator, area-equal, ===,
exists, as well as an area not equal, !==.
exists, as well as an area not equal, !==.
The negator
operator allows the query optimizer to convert
The negator
link allows the query optimizer to simplify
.nf
.nf
.ce 1
.ce 1
...
@@ -182,7 +184,7 @@ fraction of the instances in MYBOXES that satisfy the clause. The
...
@@ -182,7 +184,7 @@ fraction of the instances in MYBOXES that satisfy the clause. The
function res_proc must be a registered function (meaning it is already
function res_proc must be a registered function (meaning it is already
defined using
defined using
.IR create_function(l))
.IR create_function(l))
which accepts
one argument of the correct data type
and returns a
which accepts
arguments of the correct data types
and returns a
floating point number. The query optimizer simply calls this
floating point number. The query optimizer simply calls this
function, passing the parameter "0,0,1,1"
function, passing the parameter "0,0,1,1"
and multiplies the result by the relation size to get the desired
and multiplies the result by the relation size to get the desired
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment