begin transaction
SELECT nextval('seq_order_id') as orderId
SELECT * FROM orders WHERE accountid = ? AND status IN (3, 7)
INSERT INTO orders (orderid, ... )
end transaction
g_benchmark=# explain analyze select * from orders where accountid=1000001 and status IN (3,7);
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------
Index Scan using index_orders_accountid on orders (cost=0.00..9.37 rows=1 width=250) (actual time=3.179..3.179 rows=0 loops=1)
Index Cond: (accountid = 1000001)
Filter: ((status = 3) OR (status = 7))
Total runtime: 3.254 ms
(4 rows)