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
83527b13
Commit
83527b13
authored
Aug 03, 2010
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add EXPLAIN documentation example.
gabrielle <gorthx@gmail.com>
parent
72405b06
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
1 deletion
+46
-1
doc/src/sgml/ref/explain.sgml
doc/src/sgml/ref/explain.sgml
+46
-1
No files found.
doc/src/sgml/ref/explain.sgml
View file @
83527b13
<!--
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/explain.sgml,v 1.5
0 2010/04/03 07:23:01 petere
Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/explain.sgml,v 1.5
1 2010/08/03 17:14:19 momjian
Exp $
PostgreSQL documentation
PostgreSQL documentation
-->
-->
...
@@ -247,6 +247,29 @@ EXPLAIN SELECT * FROM foo;
...
@@ -247,6 +247,29 @@ EXPLAIN SELECT * FROM foo;
</programlisting>
</programlisting>
</para>
</para>
<para>
Here is the same query, with JSON formatting:
<programlisting>
EXPLAIN (FORMAT JSON) SELECT * FROM foo;
QUERY PLAN
--------------------------------
[ +
{ +
"Plan": { +
"Node Type": "Seq Scan",+
"Relation Name": "foo", +
"Alias": "foo", +
"Startup Cost": 0.00, +
"Total Cost": 155.00, +
"Plan Rows": 10000, +
"Plan Width": 4 +
} +
} +
]
(1 row)
</programlisting>
</para>
<para>
<para>
If there is an index and we use a query with an indexable
If there is an index and we use a query with an indexable
<literal>WHERE</literal> condition, <command>EXPLAIN</command>
<literal>WHERE</literal> condition, <command>EXPLAIN</command>
...
@@ -263,6 +286,28 @@ EXPLAIN SELECT * FROM foo WHERE i = 4;
...
@@ -263,6 +286,28 @@ EXPLAIN SELECT * FROM foo WHERE i = 4;
</programlisting>
</programlisting>
</para>
</para>
<para>
Here is the same query, but in YAML output:
<programlisting>
EXPLAIN (FORMAT YAML) SELECT * FROM foo WHERE i='4';
QUERY PLAN
-------------------------------
- Plan: +
Node Type: "Index Scan" +
Scan Direction: "Forward"+
Index Name: "fi" +
Relation Name: "foo" +
Alias: "foo" +
Startup Cost: 0.00 +
Total Cost: 5.98 +
Plan Rows: 1 +
Plan Width: 4 +
Index Cond: "(i = 4)"
(1 row)
</programlisting>
XML output is left as an exercise to the reader.
</para>
<para>
<para>
Here is the same plan with costs suppressed:
Here is the same plan with costs suppressed:
...
...
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