|
1 | 1 | <!-- |
2 | | -$PostgreSQL: pgsql/doc/src/sgml/ref/prepare.sgml,v 1.9 2003/12/01 22:07:58 momjian Exp $ |
| 2 | +$PostgreSQL: pgsql/doc/src/sgml/ref/prepare.sgml,v 1.10 2003/12/14 00:55:46 neilc Exp $ |
3 | 3 | PostgreSQL documentation |
4 | 4 | --> |
5 | 5 |
|
@@ -52,7 +52,7 @@ PREPARE <replaceable class="PARAMETER">plan_name</replaceable> [ (<replaceable c |
52 | 52 | </para> |
53 | 53 |
|
54 | 54 | <para> |
55 | | - Prepared statementsareonly for the duration of the current |
| 55 | + Prepared statements only last for the duration of the current |
56 | 56 | database session. When the session ends, the prepared statement is |
57 | 57 | forgotten, so it must be recreated before being used again. This |
58 | 58 | also means that a single prepared statement cannot be used by |
@@ -115,12 +115,12 @@ PREPARE <replaceable class="PARAMETER">plan_name</replaceable> [ (<replaceable c |
115 | 115 | <title>Notes</title> |
116 | 116 |
|
117 | 117 | <para> |
118 | | - In some situations, the query plan producedbyfor a prepared |
119 | | - statementmay be inferior to the planproduced if the statement |
120 | | -were submitted and executed normally. This is because when the |
121 | | -statementisplanned and theplanner attempts to determine the |
122 | | - optimal query plan, the actual values of any parameters specified |
123 | | - in the statement are |
| 118 | + In some situations, the query plan produced for a prepared |
| 119 | + statementwill be inferior to thequeryplanthat would have been |
| 120 | +chosen if the statement had been submitted and executed |
| 121 | +normally. Thisisbecause when thestatement is planned and the |
| 122 | +planner attempts to determine theoptimal query plan, the actual |
| 123 | +values of any parameters specifiedin the statement are |
124 | 124 | unavailable. <productname>PostgreSQL</productname> collects |
125 | 125 | statistics on the distribution of data in the table, and can use |
126 | 126 | constant values in a statement to make guesses about the likely |
|