explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6NHy

Settings
# exclusive inclusive rows x rows loops node
1. 0.078 12,748.860 ↓ 44.0 44 1

Sort (cost=728.51..728.52 rows=1 width=328) (actual time=12,748.857..12,748.860 rows=44 loops=1)

  • Sort Key: rs.rs_time
  • Sort Method: quicksort Memory: 36kB
2. 0.063 12,748.782 ↓ 44.0 44 1

Nested Loop Left Join (cost=9.25..728.50 rows=1 width=328) (actual time=58.330..12,748.782 rows=44 loops=1)

3. 0.087 12,748.191 ↓ 44.0 44 1

Nested Loop (cost=9.25..721.10 rows=1 width=212) (actual time=58.290..12,748.191 rows=44 loops=1)

4. 0.000 12,747.972 ↓ 44.0 44 1

Nested Loop (cost=8.97..718.41 rows=1 width=196) (actual time=58.276..12,747.972 rows=44 loops=1)

  • Join Filter: (ag.id = rs.fk_articlegroup)
  • Rows Removed by Join Filter: 1100
5. 25.300 25.563 ↓ 6,292.0 12,584 1

Nested Loop (cost=8.97..372.79 rows=2 width=51) (actual time=0.061..25.563 rows=12,584 loops=1)

  • -> Index Scan using idx_salearticle_client_nr_sending_subv on salearticle sa (cost=0.42..319.66 rows=267 width=16) (actual time=0.017..0.817 rows=484 loops=26
6. 0.115 0.263 ↓ 26.0 26 1

Hash Join (cost=8.54..26.43 rows=1 width=35) (actual time=0.042..0.263 rows=26 loops=1)

  • Hash Cond: (ag.fk_maingroup = mg.id)
  • Index Cond: (fk_client = 1634005599)
7. 0.129 0.129 ↓ 1.9 26 1

Index Scan using idx_articlegroup_client_nr on articlegroup ag (cost=0.29..18.14 rows=14 width=31) (actual time=0.016..0.129 rows=26 loops=1)

  • Index Cond: (fk_client = 1634005599)
8. 0.004 0.019 ↑ 1.0 7 1

Hash (cost=7.54..7.54 rows=7 width=20) (actual time=0.018..0.019 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 0.015 0.015 ↑ 1.0 7 1

Index Scan using idx_maingroup_client_nr on maingroup mg (cost=0.29..7.54 rows=7 width=20) (actual time=0.011..0.015 rows=7 loops=1)

  • Index Cond: (fk_client = 1634005599)
10. 138.424 12,722.424 ↓ 0.0 0 12,584

Append (cost=0.00..172.40 rows=4 width=169) (actual time=1.010..1.011 rows=0 loops=12,584)

11. 0.000 0.000 ↓ 0.0 0 12,584

Seq Scan on receiptsale rs (cost=0.00..0.00 rows=1 width=328) (actual time=0.000..0.000 rows=0 loops=12,584)

  • Filter: ((discountcode IS NULL) AND (NOT deleted) AND (rs_time >= '2016-12-20 07:39:00'::timestamp without time zone) AND (rs_time <= '2017-01-30 07:59:59
12. 12.584 12.584 ↓ 0.0 0 12,584

Index Scan using receiptsale_9_fk_salearticle_idx on receiptsale_9 rs_1 (cost=0.13..0.44 rows=1 width=117) (actual time=0.001..0.001 rows=0 loops=12,584)

  • Index Cond: (fk_salearticle = sa.id)
  • Filter: ((discountcode IS NULL) AND (NOT deleted) AND (rs_time >= '2016-12-20 07:39:00'::timestamp without time zone) AND (rs_time <= '2017-01-30 07:59:59
13. 138.424 6,229.080 ↓ 0.0 0 12,584

Bitmap Heap Scan on receiptsale_9_2016 rs_2 (cost=81.44..82.69 rows=1 width=116) (actual time=0.495..0.495 rows=0 loops=12,584)

  • Recheck Cond: ((fk_salearticle = sa.id) AND (fk_receipt = ANY ('{3179405632,3179406915,3179404325,3179407207,3179405639,3179408966,3179408971,3179407212,3
  • Filter: ((discountcode IS NULL) AND (NOT deleted) AND (rs_time >= '2016-12-20 07:39:00'::timestamp without time zone) AND (rs_time <= '2017-01-30 07:59:59
14. 5,796.960 6,090.656 ↓ 0.0 0 12,584

BitmapAnd (cost=81.44..81.44 rows=1 width=0) (actual time=0.484..0.484 rows=0 loops=12,584)

  • -> Bitmap Index Scan on receiptsale_9_2016_fk_salearticle_idx (cost=0.00..37.26 rows=3188 width=0) (actual time=0.399..0.399 rows=4231 loops=12584
  • Index Cond: (fk_salearticle = sa.id)
15. 293.696 293.696 ↓ 0.0 0 9,178

Bitmap Index Scan on receiptsale_9_2016_fk_receipt_idx (cost=0.00..43.93 rows=749 width=0) (actual time=0.032..0.032 rows=0 loops=9,178)

  • Index Cond: (fk_receipt = ANY ('{3179405632,3179406915,3179404325,3179407207,3179405639,3179408966,3179408971,3179407212,3179410191,3179411952
16. 151.008 6,342.336 ↓ 0.0 0 12,584

Bitmap Heap Scan on receiptsale_9_2017 rs_3 (cost=87.83..89.07 rows=1 width=115) (actual time=0.504..0.504 rows=0 loops=12,584)

  • Recheck Cond: ((fk_salearticle = sa.id) AND (fk_receipt = ANY ('{3179405632,3179406915,3179404325,3179407207,3179405639,3179408966,3179408971,3179407212,3
  • Filter: ((discountcode IS NULL) AND (NOT deleted) AND (rs_time >= '2016-12-20 07:39:00'::timestamp without time zone) AND (rs_time <= '2017-01-30 07:59:59
  • Rows Removed by Filter: 0
  • Heap Blocks: exact=650
17. 5,824.208 6,191.328 ↓ 0.0 0 12,584

BitmapAnd (cost=87.83..87.83 rows=1 width=0) (actual time=0.492..0.492 rows=0 loops=12,584)

  • -> Bitmap Index Scan on receiptsale_9_2017_fk_salearticle_idx (cost=0.00..40.89 rows=3520 width=0) (actual time=0.399..0.399 rows=3885 loops=12584
  • Index Cond: (fk_salearticle = sa.id)
18. 367.120 367.120 ↑ 23.3 48 9,178

Bitmap Index Scan on receiptsale_9_2017_fk_receipt_idx (cost=0.00..46.69 rows=1,119 width=0) (actual time=0.040..0.040 rows=48 loops=9,178)

  • Index Cond: (fk_receipt = ANY ('{3179405632,3179406915,3179404325,3179407207,3179405639,3179408966,3179408971,3179407212,3179410191,3179411952
19. 0.132 0.132 ↑ 1.0 1 44

Index Scan using operationalunit_pkey on operationalunit ou (cost=0.28..2.59 rows=1 width=24) (actual time=0.003..0.003 rows=1 loops=44)

  • Index Cond: (id = rs.fk_operationalunit)
  • Filter: (fk_client = 1634005599)
20. 0.528 0.528 ↓ 0.0 0 44

Append (cost=0.00..7.00 rows=4 width=124) (actual time=0.012..0.012 rows=0 loops=44)

  • -> Index Scan using receiptaction_9_2016_fk_receipt_idx on receiptaction_9_2016 rowcommentra_2 (cost=0.43..3.42 rows=1 width=188) (actual time=0.004..0.004 rows=0 loops=4
  • -> Index Scan using receiptaction_9_2017_fk_receipt_idx on receiptaction_9_2017 rowcommentra_3 (cost=0.43..3.38 rows=1 width=212) (actual time=0.005..0.005 rows=0 loops=4
21. 0.000 0.000 ↓ 0.0 0 44

Seq Scan on receiptaction rowcommentra (cost=0.00..0.00 rows=1 width=48) (actual time=0.000..0.000 rows=0 loops=44)

  • Filter: ((r_time >= '2016-12-20 07:39:00'::timestamp without time zone) AND (r_time <= '2017-01-30 07:59:59'::timestamp without time zone) AND (fk_client = 1634005599
22. 0.000 0.000 ↓ 0.0 0 44

Seq Scan on receiptaction_9 rowcommentra_1 (cost=0.00..0.00 rows=1 width=48) (actual time=0.000..0.000 rows=0 loops=44)

  • Filter: ((r_time >= '2016-12-20 07:39:00'::timestamp without time zone) AND (r_time <= '2017-01-30 07:59:59'::timestamp without time zone) AND (fk_client = 1634005599
  • Index Cond: (fk_receipt = rs.fk_receipt)
  • Filter: ((r_time >= '2016-12-20 07:39:00'::timestamp without time zone) AND (r_time <= '2017-01-30 07:59:59'::timestamp without time zone) AND (fk_client = 1634005599
  • Index Cond: (fk_receipt = rs.fk_receipt)
  • Filter: ((r_time >= '2016-12-20 07:39:00'::timestamp without time zone) AND (r_time <= '2017-01-30 07:59:59'::timestamp without time zone) AND (fk_client = 1634005599
  • Rows Removed by Filter: 0