explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6HSs

Settings
# exclusive inclusive rows x rows loops node
1. 0.026 822.145 ↓ 0.0 0 1

Sort (cost=129,043.65..129,043.66 rows=1 width=78) (actual time=822.145..822.145 rows=0 loops=1)

  • Sort Key: ((r.id)::character varying), rt_2.typename
  • Sort Method: quicksort Memory: 25kB
2. 0.000 822.119 ↓ 0.0 0 1

Nested Loop Left Join (cost=1,002.69..129,043.64 rows=1 width=78) (actual time=822.119..822.119 rows=0 loops=1)

  • Join Filter: (r.type = 1)
3. 105.741 907.366 ↓ 0.0 0 1

Gather (cost=1,002.69..129,038.88 rows=1 width=144) (actual time=822.119..907.366 rows=0 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
4. 644.137 801.625 ↓ 0.0 0 5

Nested Loop (cost=2.69..128,038.78 rows=1 width=144) (actual time=801.625..801.625 rows=0 loops=5)

5. 22.662 157.481 ↓ 92,414.0 92,414 5

Hash Join (cost=2.69..128,034.78 rows=1 width=50) (actual time=44.333..157.481 rows=92,414 loops=5)

  • Hash Cond: (rt_2.fk_currency = cu.id)
6. 7.384 134.704 ↓ 163.6 92,414 5

Parallel Append (cost=0.00..128,030.61 rows=565 width=54) (actual time=43.989..134.704 rows=92,414 loops=5)

7. 72.147 127.295 ↓ 163.6 92,414 5

Parallel Bitmap Heap Scan on receipttransaction_4_2019 rt_2 (cost=9,206.86..127,999.95 rows=565 width=54) (actual time=43.982..127.295 rows=92,414 loops=5)

  • Recheck Cond: ((fk_client = '2637046924'::bigint) AND (rt_time > '2019-03-29 23:36:26.217'::timestamp without time zone) AND (rt_time <= '2019-05-10 00:36:26.858'::timestamp without time zone))
  • Filter: ((NOT ignoreinreporting) AND ((fk_client % '10'::bigint) = '4'::bigint))
  • Heap Blocks: exact=5220
8. 55.148 55.148 ↓ 1.0 462,068 1

Bitmap Index Scan on receipttransaction_4_2019_fk_client_rt_time_idx (cost=0.00..9,206.30 rows=451,701 width=0) (actual time=55.148..55.148 rows=462,068 loops=1)

  • Index Cond: ((fk_client = '2637046924'::bigint) AND (rt_time > '2019-03-29 23:36:26.217'::timestamp without time zone) AND (rt_time <= '2019-05-10 00:36:26.858'::timestamp without time zone))
9. 0.024 0.024 ↓ 0.0 0 1

Parallel Index Scan using receipttransaction_4_fk_client_rt_time_idx on receipttransaction_4 rt_1 (cost=0.14..2.41 rows=1 width=45) (actual time=0.024..0.024 rows=0 loops=1)

  • Index Cond: ((fk_client = '2637046924'::bigint) AND (rt_time > '2019-03-29 23:36:26.217'::timestamp without time zone) AND (rt_time <= '2019-05-10 00:36:26.858'::timestamp without time zone))
  • Filter: ((NOT ignoreinreporting) AND ((fk_client % '10'::bigint) = '4'::bigint))
10. 0.001 0.001 ↓ 0.0 0 1

Parallel Seq Scan on receipttransaction rt (cost=0.00..0.00 rows=1 width=158) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: ((NOT ignoreinreporting) AND (rt_time > '2019-03-29 23:36:26.217'::timestamp without time zone) AND (rt_time <= '2019-05-10 00:36:26.858'::timestamp without time zone) AND (fk_client = '2637046924'::bigint) AND ((fk_client % '10'::bigint) = '4'::bigint))
11. 0.009 0.115 ↑ 1.0 1 5

Hash (cost=2.59..2.59 rows=1 width=12) (actual time=0.115..0.115 rows=1 loops=5)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
12. 0.106 0.106 ↑ 1.0 1 5

Index Scan using currency_fk_client_key on currency cu (cost=0.28..2.59 rows=1 width=12) (actual time=0.105..0.106 rows=1 loops=5)

  • Index Cond: (fk_client = '2637046924'::bigint)
13. 0.001 0.007 ↓ 0.0 0 462,068

Append (cost=0.00..3.69 rows=3 width=102) (actual time=0.007..0.007 rows=0 loops=462,068)

14. 0.000 0.000 ↓ 0.0 0 462,068

Seq Scan on receipt r (cost=0.00..0.00 rows=1 width=118) (actual time=0.000..0.000 rows=0 loops=462,068)

  • Filter: ((r_time > '2019-03-29 23:36:26.217'::timestamp without time zone) AND (r_time <= '2019-05-10 00:36:26.858'::timestamp without time zone) AND (salesreadingtime > '2019-05-09 23:36:26.217'::timestamp without time zone) AND (salesreadingtime <= '2019-05-10 00:36:26.858'::timestamp without time zone) AND (fk_client = '2637046924'::bigint) AND (rt_2.fk_receipt = id) AND ((fk_client % '10'::bigint) = '4'::bigint) AND (type <> ALL ('{3,4,5,7,8,11,15,16,18,20,21}'::integer[])))
15. 0.001 0.001 ↓ 0.0 0 462,068

Index Scan using receipt_4_pkey on receipt_4 r_1 (cost=0.14..0.82 rows=1 width=118) (actual time=0.001..0.001 rows=0 loops=462,068)

  • Index Cond: (id = rt_2.fk_receipt)
  • Filter: ((r_time > '2019-03-29 23:36:26.217'::timestamp without time zone) AND (r_time <= '2019-05-10 00:36:26.858'::timestamp without time zone) AND (salesreadingtime > '2019-05-09 23:36:26.217'::timestamp without time zone) AND (salesreadingtime <= '2019-05-10 00:36:26.858'::timestamp without time zone) AND (fk_client = '2637046924'::bigint) AND ((fk_client % '10'::bigint) = '4'::bigint) AND (type <> ALL ('{3,4,5,7,8,11,15,16,18,20,21}'::integer[])))
16. 0.005 0.005 ↓ 0.0 0 462,068

Index Scan using receipt_4_2019_pkey on receipt_4_2019 r_2 (cost=0.43..2.72 rows=1 width=69) (actual time=0.005..0.005 rows=0 loops=462,068)

  • Index Cond: (id = rt_2.fk_receipt)
  • Filter: ((r_time > '2019-03-29 23:36:26.217'::timestamp without time zone) AND (r_time <= '2019-05-10 00:36:26.858'::timestamp without time zone) AND (salesreadingtime > '2019-05-09 23:36:26.217'::timestamp without time zone) AND (salesreadingtime <= '2019-05-10 00:36:26.858'::timestamp without time zone) AND (fk_client = '2637046924'::bigint) AND ((fk_client % '10'::bigint) = '4'::bigint) AND (type <> ALL ('{3,4,5,7,8,11,15,16,18,20,21}'::integer[])))
  • Rows Removed by Filter: 1
17. 0.000 0.000 ↓ 0.0 0

Append (cost=0.00..4.41 rows=3 width=41) (never executed)

18. 0.000 0.000 ↓ 0.0 0

Seq Scan on receipt rr (cost=0.00..0.00 rows=1 width=90) (never executed)

  • Filter: ((r_time > '2019-03-29 23:36:26.217'::timestamp without time zone) AND (r_time <= '2019-05-10 00:36:26.858'::timestamp without time zone) AND (fk_client = '2637046924'::bigint) AND ((sourcehash)::text = (r.cancelledreceiptsourcehash)::text) AND ((fk_client % '10'::bigint) = '4'::bigint) AND (type <> ALL ('{3,4,5,7,8,11,15,16,18,20,21}'::integer[])))
19. 0.000 0.000 ↓ 0.0 0

Index Scan using receipt_4_sourcehash_idx on receipt_4 rr_1 (cost=0.14..1.37 rows=1 width=41) (never executed)

  • Index Cond: ((sourcehash)::text = (r.cancelledreceiptsourcehash)::text)
  • Filter: ((r_time > '2019-03-29 23:36:26.217'::timestamp without time zone) AND (r_time <= '2019-05-10 00:36:26.858'::timestamp without time zone) AND (fk_client = '2637046924'::bigint) AND ((fk_client % '10'::bigint) = '4'::bigint) AND (type <> ALL ('{3,4,5,7,8,11,15,16,18,20,21}'::integer[])))
20. 0.000 0.000 ↓ 0.0 0

Index Scan using receipt_4_2019_sourcehash_idx on receipt_4_2019 rr_2 (cost=0.56..2.89 rows=1 width=41) (never executed)

  • Index Cond: ((sourcehash)::text = (r.cancelledreceiptsourcehash)::text)
  • Filter: ((r_time > '2019-03-29 23:36:26.217'::timestamp without time zone) AND (r_time <= '2019-05-10 00:36:26.858'::timestamp without time zone) AND (fk_client = '2637046924'::bigint) AND ((fk_client % '10'::bigint) = '4'::bigint) AND (type <> ALL ('{3,4,5,7,8,11,15,16,18,20,21}'::integer[])))
Planning time : 74.222 ms
Execution time : 907.641 ms