explain.depesz.com

PostgreSQL's explain analyze made readable

Result: dTK8

Settings
# exclusive inclusive rows x rows loops node
1. 0.703 22,857.893 ↓ 346.0 346 1

Sort (cost=5,450.09..5,450.10 rows=1 width=165) (actual time=22,857.865..22,857.893 rows=346 loops=1)

  • Sort Key: rs.rs_time
  • Sort Method: quicksort Memory: 116kB
  • Planning time: 23.425 ms
  • Execution time: 22858.269 ms
2. 0.496 22,857.190 ↓ 346.0 346 1

Nested Loop (cost=103.01..5,450.08 rows=1 width=165) (actual time=14,158.159..22,857.190 rows=346 loops=1)

3. 0.431 22,855.310 ↓ 346.0 346 1

Nested Loop (cost=102.72..5,444.35 rows=1 width=153) (actual time=14,158.120..22,855.310 rows=346 loops=1)

4. 0.603 22,852.111 ↓ 346.0 346 1

Nested Loop (cost=102.30..5,436.35 rows=1 width=145) (actual time=14,158.079..22,852.111 rows=346 loops=1)

5. 0.519 22,849.778 ↓ 173.0 346 1

Hash Join (cost=102.01..5,425.70 rows=2 width=130) (actual time=14,158.036..22,849.778 rows=346 loops=1)

  • Hash Cond: (rs.fk_operationalunit = ou.id)
6. 0.558 22,848.067 ↑ 1.8 346 1

Nested Loop (cost=3.17..5,318.81 rows=637 width=114) (actual time=14,156.807..22,848.067 rows=346 loops=1)

7. 0.355 0.429 ↓ 1.1 211 1

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

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

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

9. 2.110 22,847.080 ↑ 2.0 2 211

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

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'::timestamp without time zone) AND ("*VALUES*".column1 = fk_receipt) AND (fk_client = ANY ('{3635255996,4676302706,3316044236}'::bigint[]))
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'::timestamp without time zone) AND ("*VALUES*".column1 = fk_receipt) AND (fk_client = ANY ('{3635255996,4676302706,3316044236}'::bigint[]))
12. 22,722.590 22,722.590 ↓ 0.0 0 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=107.690..107.690 rows=0 loops=211)

  • 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 <= '2019-02-05 04:59:59.99'::timestamp without time zone))
  • Filter: ((discountcode IS NULL) AND (NOT deleted) AND ("*VALUES*".column1 = fk_receipt) AND ((fk_client % '10'::bigint) = '6'::bigint))
  • Rows Removed by Filter: 68743
13. 122.380 122.380 ↓ 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.505..0.580 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'::timestamp without time zone) AND (fk_client = ANY ('{3635255996,4676302706,3316044236}'::bigint[])) AND ((fk_client % '10'::bigint) = '6'
  • Rows Removed by Filter: 0
14. 0.021 1.192 ↓ 1.1 11 1

Hash (cost=98.72..98.72 rows=10 width=24) (actual time=1.192..1.192 rows=11 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
15. 1.171 1.171 ↓ 1.1 11 1

Seq Scan on operationalunit ou (cost=0.00..98.72 rows=10 width=24) (actual time=0.654..1.171 rows=11 loops=1)

  • Filter: (fk_client = ANY ('{3635255996,4676302706,3316044236}'::bigint[]))
  • Rows Removed by Filter: 3970
16. 1.730 1.730 ↑ 1.0 1 346

Index Scan using articlegroup_pkey on articlegroup ag (cost=0.29..5.30 rows=1 width=31) (actual time=0.005..0.005 rows=1 loops=346)

  • Index Cond: (id = rs.fk_articlegroup)
  • Filter: (fk_client = ANY ('{3635255996,4676302706,3316044236}'::bigint[]))
17. 2.768 2.768 ↑ 1.0 1 346

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

  • Index Cond: (id = rs.fk_salearticle)
  • Filter: (fk_client = ANY ('{3635255996,4676302706,3316044236}'::bigint[]))
18. 1.384 1.384 ↑ 1.0 1 346

Index Scan using maingroup_pkey on maingroup mg (cost=0.29..5.28 rows=1 width=20) (actual time=0.004..0.004 rows=1 loops=346)

  • Index Cond: (id = ag.fk_maingroup)
  • Filter: (fk_client = ANY ('{3635255996,4676302706,3316044236}'::bigint[]))