Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita276392

Browse files
committed
Update example of partially constraining join order to use a subselect
in FROM instead of an auxiliary view. We didn't have subselect-in-FROMwhen I wrote this originally...
1 parentfa0cd64 commita276392

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

‎doc/src/sgml/perform.sgml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/perform.sgml,v 1.1 2000/12/16 02:29:36 tgl Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/perform.sgml,v 1.2 2001/02/19 00:24:30 tgl Exp $
33
-->
44

55
<chapter id="performance-tips">
@@ -350,10 +350,11 @@ SELECT * FROM a CROSS JOIN b, c, d, e WHERE ...;
350350
might not want to constrain the planner's search for a good ordering
351351
of inner joins inside an outer join. You can't do that directly in the
352352
JOIN syntax, but you can get around the syntactic limitation by using
353-
views. For example,
353+
subselects. For example,
354354
<programlisting>
355-
CREATE VIEW v1 AS SELECT ... FROM a, b, c WHERE ...;
356-
SELECT * FROM d LEFT JOIN v1 ON (...);
355+
SELECT * FROM d LEFT JOIN
356+
(SELECT * FROM a, b, c WHERE ...) AS ss
357+
ON (...);
357358
</programlisting>
358359
Here, joining D must be the last step in the query plan, but the
359360
planner is free to consider various join orders for A,B,C.
@@ -397,7 +398,7 @@ SELECT * FROM d LEFT JOIN v1 ON (...);
397398
command, instead
398399
of a series of INSERT commands. This reduces parsing, planning, etc
399400
overhead a great deal. If you do this then it's not necessary to fool
400-
around with autocommit.
401+
around with autocommit, since it's only one command anyway.
401402
</para>
402403
</sect2>
403404

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp