EXPLAIN (ANALYZE, BUFFERS) SELECT t0."amount", t0."currency_code", t0."end_balance", t0."id", t0."inserted_at", t0."main_ref_type", t0."references", t0."updated_at" FROM "transactions" AS t0 WHERE (t0."site_id" = ANY(ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12])) AND ("references"[2] = '(USER,53)'::transaction_reference) ORDER BY t0."id" DESC LIMIT 20 OFFSET 0;
QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=44.80..44.81 rows=3 width=285) (actual time=0.136..0.138 rows=5 loops=1)
Buffers: shared hit=27
-> Sort (cost=44.80..44.81 rows=3 width=285) (actual time=0.135..0.136 rows=5 loops=1)
Sort Key: id DESC
Sort Method: quicksort Memory: 26kB
Buffers: shared hit=27
-> Bitmap Heap Scan on transactions t0 (cost=35.14..44.78 rows=3 width=285) (actual time=0.107..0.115 rows=5 loops=1)
Recheck Cond: ((site_id = ANY ('{1,2,3,4,5,6,7,8,9,10,12}'::integer[])) AND ("references"[2] = '(USER,53)'::transaction_reference))
Heap Blocks: exact=5
Buffers: shared hit=27
-> Bitmap Index Scan on transaction_site_id_references_user_offset_index (cost=0.00..35.13 rows=3 width=0) (actual time=0.097..0.097 rows=5 loops=1)
Index Cond: ((site_id = ANY ('{1,2,3,4,5,6,7,8,9,10,12}'::integer[])) AND ("references"[2] = '(USER,53)'::transaction_reference))
Buffers: shared hit=22
Planning Time: 0.322 ms
Execution Time: 0.180 ms
(15 rows)
EXPLAIN (ANALYZE, BUFFERS) SELECT t0."amount", t0."currency_code", t0."end_balance", t0."id", t0."inserted_at", t0."main_ref_type", t0."references", t0."updated_at" FROM "transactions" AS t0 WHERE (t0."site_id" = ANY(ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12])) AND ("references"[2] = '(USER,53)'::transaction_reference) ORDER BY t0."id" DESC LIMIT 20 OFFSET 0;
EXPLAIN (
analyze,
buffers
)
SELECT
t0.amount,
t0.currency_code,
t0.end_balance,
t0.id,
t0.inserted_at,
t0.main_ref_type,
t0.references,
t0.updated_at
FROM
transactions AS t0
WHERE
t0.site_id = ANY( ARRAY[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12 ] ) AND
references[2] = '(USER,53)'::transaction_reference
ORDER BY
t0.id DESC
LIMIT 20
OFFSET 0;
-- Formatted by Pg::SQL::PrettyPrinter