APPEND optimizer hint v16

By default, EDB Postgres Advanced Server adds new data into the first available free space in a table vacated by vacuumed records. Include the APPEND directive after an INSERT or SELECT command to bypass midtable free space and affix new rows to the end of the table. This optimizer hint can be particularly useful when bulk loading data.

The syntax is:

/*+APPEND*/

For example, the following command, compatible with Oracle databases, instructs the server to append the data in the INSERT statement to the end of the sales table:

INSERT /*+APPEND*/ INTO sales VALUES
(10, 10, '01-Mar-2011', 10, 'OR');

EDB Postgres Advanced Server supports the APPEND hint when adding multiple rows in a single INSERT statement:

INSERT /*+APPEND*/ INTO sales VALUES
(20, 20, '01-Aug-2011', 20, 'NY'),
(30, 30, '01-Feb-2011', 30, 'FL'),
(40, 40, '01-Nov-2011', 40, 'TX');

You can also include the APPEND hint in the SELECT clause of an INSERT INTO statement:

INSERT INTO sales_history SELECT /*+APPEND*/ FROM sales;