Inserting Rows Into Queue Tables
The first column of a queue table is defined as a Queue Insertion TimeStamp (QITS) column. The values in the column determine the order of the rows in the queue, resulting in approximate first-in-first-out (FIFO) ordering.
If you want the QITS value of a row to indicate the time that the row was inserted into the queue table, then you can use the default value, the result of CURRENT_TIMESTAMP, instead of supplying a value. If you want to control the placement of a row in the FIFO order, you can supply a TIMESTAMP value for the QITS column.
For a multistatement request containing multiple INSERT requests that do not supply values for the QITS column, the QITS values are the same for every row inserted.
If you want unique QITS values for every row in a queue table, you can do any of the following things:
For example:
INSERT shopping_cart(CURRENT_TIMESTAMP + INTERVAL '0.001', 100)
;INSERT shopping_cart(CURRENT_TIMESTAMP + INTERVAL '0.002', 200)
;INSERT shopping_cart(CURRENT_TIMESTAMP + INTERVAL '0.003', 300);
Regarding performance, an INSERT operation into a queue table has the following effects:
For details on queue tables and the queue table cache, see “CREATE TABLE” in SQL Data Definition Language.