explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Npw2

Settings
# exclusive inclusive rows x rows loops node
1. 0.029 566.336 ↓ 0.0 0 1

Sort (cost=65,529.60..65,529.60 rows=1 width=78) (actual time=566.336..566.336 rows=0 loops=1)

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

Nested Loop Left Join (cost=1,002.69..65,529.59 rows=1 width=78) (actual time=566.307..566.307 rows=0 loops=1)

  • Join Filter: (r.type = 1)
3. 41.426 566.307 ↓ 0.0 0 1

Nested Loop (cost=1,002.69..65,524.82 rows=1 width=144) (actual time=566.306..566.307 rows=0 loops=1)

4. 7.440 56.716 ↓ 93,633.0 93,633 1

Gather (cost=1,002.69..65,520.78 rows=1 width=50) (actual time=25.169..56.716 rows=93,633 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
5. 7.551 49.276 ↓ 18,727.0 18,727 5

Hash Join (cost=2.69..64,520.68 rows=1 width=50) (actual time=8.378..49.276 rows=18,727 loops=5)

  • Hash Cond: (rt_2.fk_currency = cu.id)
6. 2.333 41.647 ↓ 183.6 18,727 5

Parallel Append (cost=0.00..64,517.73 rows=102 width=54) (actual time=8.208..41.647 rows=18,727 loops=5)

7. 19.585 39.288 ↓ 183.6 18,727 5

Parallel Bitmap Heap Scan on receipttransaction_4_2019 rt_2 (cost=1,673.07..64,510.22 rows=102 width=54) (actual time=8.202..39.288 rows=18,727 loops=5)

  • Recheck Cond: ((fk_client = '2637079944'::bigint) AND (rt_time > '2019-03-31 04:36:26.43'::timestamp without time zone) AND (rt_time <= '2019-05-11 04:36:26.339'::timestamp without time zone))
  • Filter: ((NOT ignoreinreporting) AND ((fk_client % '10'::bigint) = '4'::bigint))
  • Heap Blocks: exact=2
8. 19.703 19.703 ↓ 1.1 93,633 1

Bitmap Index Scan on receipttransaction_4_2019_fk_client_rt_time_idx (cost=0.00..1,672.97 rows=81,795 width=0) (actual time=19.703..19.703 rows=93,633 loops=1)

  • Index Cond: ((fk_client = '2637079944'::bigint) AND (rt_time > '2019-03-31 04:36:26.43'::timestamp without time zone) AND (rt_time <= '2019-05-11 04:36:26.339'::timestamp without time zone))
9. 0.026 0.026 ↓ 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.026..0.026 rows=0 loops=1)

  • Index Cond: ((fk_client = '2637079944'::bigint) AND (rt_time > '2019-03-31 04:36:26.43'::timestamp without time zone) AND (rt_time <= '2019-05-11 04:36:26.339'::timestamp without time zone))
  • Filter: ((NOT ignoreinreporting) AND ((fk_client % '10'::bigint) = '4'::bigint))
10. 0.000 0.000 ↓ 0.0 0 1

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

  • Filter: ((NOT ignoreinreporting) AND (rt_time > '2019-03-31 04:36:26.43'::timestamp without time zone) AND (rt_time <= '2019-05-11 04:36:26.339'::timestamp without time zone) AND (fk_client = '2637079944'::bigint) AND ((fk_client % '10'::bigint) = '4'::bigint))
11. 0.006 0.078 ↑ 1.0 1 5

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
12. 0.072 0.072 ↑ 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.070..0.072 rows=1 loops=5)

  • Index Cond: (fk_client = '2637079944'::bigint)
13. 93.633 468.165 ↓ 0.0 0 93,633

Append (cost=0.00..3.74 rows=3 width=102) (actual time=0.005..0.005 rows=0 loops=93,633)

14. 0.000 0.000 ↓ 0.0 0 93,633

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

  • Filter: ((r_time > '2019-03-31 04:36:26.43'::timestamp without time zone) AND (r_time <= '2019-05-11 04:36:26.339'::timestamp without time zone) AND (salesreadingtime > '2019-05-11 03:36:26.43'::timestamp without time zone) AND (salesreadingtime <= '2019-05-11 04:36:26.339'::timestamp without time zone) AND (fk_client = '2637079944'::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.000 0.000 ↓ 0.0 0 93,633

Index Scan using receipt_4_pkey on receipt_4 r_1 (cost=0.14..0.83 rows=1 width=118) (actual time=0.000..0.000 rows=0 loops=93,633)

  • Index Cond: (id = rt_2.fk_receipt)
  • Filter: ((r_time > '2019-03-31 04:36:26.43'::timestamp without time zone) AND (r_time <= '2019-05-11 04:36:26.339'::timestamp without time zone) AND (salesreadingtime > '2019-05-11 03:36:26.43'::timestamp without time zone) AND (salesreadingtime <= '2019-05-11 04:36:26.339'::timestamp without time zone) AND (fk_client = '2637079944'::bigint) AND ((fk_client % '10'::bigint) = '4'::bigint) AND (type <> ALL ('{3,4,5,7,8,11,15,16,18,20,21}'::integer[])))
16. 374.532 374.532 ↓ 0.0 0 93,633

Index Scan using receipt_4_2019_pkey on receipt_4_2019 r_2 (cost=0.43..2.76 rows=1 width=69) (actual time=0.004..0.004 rows=0 loops=93,633)

  • Index Cond: (id = rt_2.fk_receipt)
  • Filter: ((r_time > '2019-03-31 04:36:26.43'::timestamp without time zone) AND (r_time <= '2019-05-11 04:36:26.339'::timestamp without time zone) AND (salesreadingtime > '2019-05-11 03:36:26.43'::timestamp without time zone) AND (salesreadingtime <= '2019-05-11 04:36:26.339'::timestamp without time zone) AND (fk_client = '2637079944'::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-31 04:36:26.43'::timestamp without time zone) AND (r_time <= '2019-05-11 04:36:26.339'::timestamp without time zone) AND (fk_client = '2637079944'::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-31 04:36:26.43'::timestamp without time zone) AND (r_time <= '2019-05-11 04:36:26.339'::timestamp without time zone) AND (fk_client = '2637079944'::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-31 04:36:26.43'::timestamp without time zone) AND (r_time <= '2019-05-11 04:36:26.339'::timestamp without time zone) AND (fk_client = '2637079944'::bigint) AND ((fk_client % '10'::bigint) = '4'::bigint) AND (type <> ALL ('{3,4,5,7,8,11,15,16,18,20,21}'::integer[])))