|
8 | 8 | *Result nodes are used in queries where no relations are scanned. |
9 | 9 | *Examples of such queries are: |
10 | 10 | * |
11 | | - *retrieve (x = 1) |
12 | | - *and |
13 | | - *append emp (name = "mike", salary = 15000) |
| 11 | + *select 1 * 2 |
14 | 12 | * |
15 | 13 | *Result nodes are also used to optimise queries with constant |
16 | 14 | *qualifications (ie, quals that do not depend on the scanned data), |
17 | 15 | *such as: |
18 | 16 | * |
19 | | - *retrieve (emp.all) where 2 > 1 |
| 17 | + *select * fromemp where 2 > 1 |
20 | 18 | * |
21 | 19 | *In this case, the plan generated is |
22 | 20 | * |
23 | 21 | *Result(with 2 > 1 qual) |
24 | 22 | */ |
25 | 23 | * SeqScan (emp.all) |
26 | 24 | * |
27 | | - *At runtime, the Result node evaluates the constant qual once. |
28 | | - *If it's false, we can return an empty result set without running |
29 | | - *the controlled plan at all. If it's true, we run the controlled |
| 25 | + *At runtime, the Result node evaluates the constant qual once, |
| 26 | + *which is shown by EXPLAIN as a One-Time Filter. If it's |
| 27 | + *false, we can return an empty result set without running the |
| 28 | + *controlled plan at all. If it's true, we run the controlled |
30 | 29 | *plan normally and pass back the results. |
31 | 30 | * |
32 | 31 | * |
33 | 32 | * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group |
34 | 33 | * Portions Copyright (c) 1994, Regents of the University of California |
35 | 34 | * |
36 | 35 | * IDENTIFICATION |
37 | | - * $PostgreSQL: pgsql/src/backend/executor/nodeResult.c,v 1.29 2004/12/31 21:59:45 pgsql Exp $ |
| 36 | + * $PostgreSQL: pgsql/src/backend/executor/nodeResult.c,v 1.30 2005/04/24 11:46:21 neilc Exp $ |
38 | 37 | * |
39 | 38 | *------------------------------------------------------------------------- |
40 | 39 | */ |
|