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
18fd0bda
Commit
18fd0bda
authored
Mar 31, 2000
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve wording a little bit.
parent
05e92dd5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
13 deletions
+15
-13
doc/src/sgml/plan.sgml
doc/src/sgml/plan.sgml
+15
-13
No files found.
doc/src/sgml/plan.sgml
View file @
18fd0bda
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/plan.sgml,v 2.
2 2000/03/31 03:27:41 thomas
Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/plan.sgml,v 2.
3 2000/03/31 17:45:00 tgl
Exp $
-->
<chapter>
...
...
@@ -31,7 +31,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/plan.sgml,v 2.2 2000/03/31 03:27:41 t
<para>
Plan-reading is an art that deserves a tutorial, and I haven't
had time to write one. Here is some quick & dirty explanation.
had time to write one. Here is some quick &
amp;
dirty explanation.
</para>
<para>
...
...
@@ -69,9 +69,10 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/plan.sgml,v 2.2 2000/03/31 03:27:41 t
</para>
<para>
The costs are measured in units of disk page fetches. (There are some
fairly bogus fudge-factors for converting CPU effort estimates into
disk-fetch units; see the SET ref page if you want to play with these.)
The costs are measured in units of disk page fetches. (CPU effort
estimates are converted into disk-page units using some
fairly arbitrary fudge-factors. See the <command>SET</command>
reference page if you want to experiment with these.)
It's important to note that the cost of an upper-level node includes
the cost of all its child nodes. It's also important to realize that
the cost only reflects things that the planner/optimizer cares about.
...
...
@@ -83,7 +84,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/plan.sgml,v 2.2 2000/03/31 03:27:41 t
</para>
<para>
Rows output is a little tricky because it is
*not*
the number of rows
Rows output is a little tricky because it is
<emphasis>not</emphasis>
the number of rows
processed/scanned by the query --- it is usually less, reflecting the
estimated selectivity of any WHERE-clause constraints that are being
applied at this node.
...
...
@@ -98,7 +99,7 @@ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/plan.sgml,v 2.2 2000/03/31 03:27:41 t
<para>
Here are some examples (using the regress test database after a
vacuum analyze, and
current
sources):
vacuum analyze, and
almost-7.0
sources):
<programlisting>
regression=# explain select * from tenk1;
...
...
@@ -109,7 +110,7 @@ Seq Scan on tenk1 (cost=0.00..333.00 rows=10000 width=148)
</para>
<para>
A
bout as straightforward as it gets. If you do
This is a
bout as straightforward as it gets. If you do
<programlisting>
select * from pg_class where relname = 'tenk1';
...
...
@@ -131,7 +132,7 @@ NOTICE: QUERY PLAN:
Seq Scan on tenk1 (cost=0.00..358.00 rows=1000 width=148)
</programlisting>
Estimated
output rows has gone down because of the WHERE clause.
The estimate of
output rows has gone down because of the WHERE clause.
(The uncannily accurate estimate is just because tenk1 is a particularly
simple case --- the unique1 column has 10000 distinct values ranging
from 0 to 9999, so the estimator's linear interpolation between min and
...
...
@@ -191,10 +192,11 @@ Nested Loop (cost=0.00..144.07 rows=100 width=296)
<para>
In this nested-loop join, the outer scan is the same indexscan we had
in the example before last, and
the
cost and row count are the same
because we are applying the "unique1 < 100" WHERE clause at th
is
node.
in the example before last, and
so its
cost and row count are the same
because we are applying the "unique1 < 100" WHERE clause at th
at
node.
The "t1.unique2 = t2.unique2" clause isn't relevant yet, so it doesn't
affect the row count. For the inner scan, we assume that the current
affect the outer scan's row count. For the inner scan, the
current
outer-scan tuple's unique2 value is plugged into the inner indexscan
to produce an indexqual like
"t2.unique2 = <replaceable>constant</replaceable>". So we get the
...
...
@@ -221,7 +223,7 @@ Nested Loop (cost=0.00..144.07 rows=100 width=296)
but it's what we've got at the moment):
<programlisting>
regression=# set enable_nestloop =
'off'
;
regression=# set enable_nestloop =
off
;
SET VARIABLE
regression=# explain select * from tenk1 t1, tenk2 t2 where t1.unique1 < 100
regression-# and t1.unique2 = t2.unique2;
...
...
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