explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FY5B

Settings
# exclusive inclusive rows x rows loops node
1. 0.683 8,586.465 ↑ 1.8 346 1

Sort (cost=12,070.35..12,071.94 rows=637 width=165) (actual time=8,586.421..8,586.465 rows=346 loops=1)

  • Sort Key: rs.rs_time
  • Sort Method: quicksort Memory: 116kB
2. 0.500 8,585.782 ↑ 1.8 346 1

Hash Join (cost=1,609.46..12,040.68 rows=637 width=165) (actual time=88.128..8,585.782 rows=346 loops=1)

  • Hash Cond: (rs.fk_operationalunit = ou.id)
3. 0.511 8,582.667 ↑ 1.8 346 1

Hash Join (cost=1,476.56..11,899.73 rows=637 width=141) (actual time=85.482..8,582.667 rows=346 loops=1)

  • Hash Cond: (ag.fk_maingroup = mg.id)
4. 0.705 8,575.482 ↑ 1.8 346 1

Hash Join (cost=1,128.12..11,543.25 rows=637 width=137) (actual time=78.711..8,575.482 rows=346 loops=1)

  • Hash Cond: (rs.fk_articlegroup = ag.id)
5. 0.397 8,559.835 ↑ 1.8 346 1

Nested Loop (cost=3.59..10,410.68 rows=637 width=122) (actual time=63.611..8,559.835 rows=346 loops=1)

6. 0.471 8,557.362 ↑ 1.8 346 1

Nested Loop (cost=3.17..5,318.81 rows=637 width=114) (actual time=63.596..8,557.362 rows=346 loops=1)

7. 0.346 0.419 ↓ 1.1 211 1

HashAggregate (cost=3.17..5.17 rows=200 width=8) (actual time=0.158..0.419 rows=211 loops=1)

  • Group Key: "*VALUES*".column1
8. 0.073 0.073 ↑ 1.0 211 1

Values Scan on "*VALUES*" (cost=0.00..2.64 rows=211 width=8) (actual time=0.006..0.073 rows=211 loops=1)

9. 8,554.573 8,556.472 ↑ 2.0 2 211

Append (cost=0.00..26.53 rows=4 width=114) (actual time=40.551..40.552 rows=2 loops=211)

  • -> Index Scan using receiptsale_6_2018_fk_client_rs_time_fk_operationalunit_idx on receiptsale_6_2018 rs_2 (cost=0.56..17.75 rows=1 width=113) (actual time=40.532..40.532 r
10. 0.000 0.000 ↓ 0.0 0 211

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

  • Filter: ((discountcode IS NULL) AND (NOT deleted) AND (rs_time >= '2018-12-25 05:00:00'::timestamp without time zone) AND (rs_time <= '2019-02-05 04:59:59.99'::timestam
11. 0.000 0.000 ↓ 0.0 0 211

Seq Scan on receiptsale_6 rs_1 (cost=0.00..0.00 rows=1 width=328) (actual time=0.000..0.000 rows=0 loops=211)

  • Filter: ((discountcode IS NULL) AND (NOT deleted) AND (rs_time >= '2018-12-25 05:00:00'::timestamp without time zone) AND (rs_time <= '2019-02-05 04:59:59.99'::timestam
  • Index Cond: ((fk_client = ANY ('{3635255996,4676302706,3316044236}'::bigint[])) AND (rs_time >= '2018-12-25 05:00:00'::timestamp without time zone) AND (rs_time <= '201
  • Filter: ((discountcode IS NULL) AND (NOT deleted) AND ("*VALUES*".column1 = fk_receipt) AND ((fk_client % '10'::bigint) = '6'::bigint))
  • Rows Removed by Filter: 68743
12. 1.899 1.899 ↓ 2.0 2 211

Index Scan using receiptsale_6_2019_fk_receipt_idx on receiptsale_6_2019 rs_3 (cost=0.43..8.78 rows=1 width=114) (actual time=0.009..0.009 rows=2 loops=211)

  • Index Cond: (fk_receipt = "*VALUES*".column1)
  • Filter: ((discountcode IS NULL) AND (NOT deleted) AND (rs_time >= '2018-12-25 05:00:00'::timestamp without time zone) AND (rs_time <= '2019-02-05 04:59:59.99'::timestam
  • Rows Removed by Filter: 0
13. 2.076 2.076 ↑ 1.0 1 346

Index Scan using salearticle_pkey on salearticle sa (cost=0.42..7.99 rows=1 width=16) (actual time=0.006..0.006 rows=1 loops=346)

  • Index Cond: (id = rs.fk_salearticle)
14. 6.892 14.942 ↓ 1.0 27,762 1

Hash (cost=777.57..777.57 rows=27,757 width=31) (actual time=14.942..14.942 rows=27,762 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 2087kB
15. 8.050 8.050 ↓ 1.0 27,762 1

Seq Scan on articlegroup ag (cost=0.00..777.57 rows=27,757 width=31) (actual time=0.022..8.050 rows=27,762 loops=1)

16. 3.236 6.674 ↓ 1.0 10,350 1

Hash (cost=220.97..220.97 rows=10,197 width=20) (actual time=6.674..6.674 rows=10,350 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 713kB
17. 3.438 3.438 ↓ 1.0 10,350 1

Seq Scan on maingroup mg (cost=0.00..220.97 rows=10,197 width=20) (actual time=0.015..3.438 rows=10,350 loops=1)

18. 1.380 2.615 ↓ 1.0 3,981 1

Hash (cost=84.07..84.07 rows=3,907 width=24) (actual time=2.615..2.615 rows=3,981 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 265kB
19. 1.235 1.235 ↓ 1.0 3,981 1

Seq Scan on operationalunit ou (cost=0.00..84.07 rows=3,907 width=24) (actual time=0.013..1.235 rows=3,981 loops=1)