explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 35Rv

Settings
# exclusive inclusive rows x rows loops node
1. 0.127 33.349 ↓ 59.2 296 1

Sort (cost=134.38..134.39 rows=5 width=257) (actual time=33.326..33.349 rows=296 loops=1)

  • Sort Key: p.price_order_type DESC
  • Sort Method: quicksort Memory: 99kB
2. 1.647 33.222 ↓ 59.2 296 1

HashAggregate (cost=134.27..134.32 rows=5 width=257) (actual time=33.149..33.222 rows=296 loops=1)

  • Group Key: p.id, p.title, p.customer_id, p.price_order_type, vb2.code_small, (CASE WHEN ((co.short_name IS NULL) OR ((co.short_name)::text = ''::text)) THEN co.full_name ELSE co.short_name END)
3. 0.177 31.575 ↓ 340.0 1,700 1

Append (cost=23.98..134.19 rows=5 width=257) (actual time=0.298..31.575 rows=1,700 loops=1)

4. 0.402 19.310 ↓ 185.7 557 1

Nested Loop (cost=23.98..72.37 rows=3 width=257) (actual time=0.298..19.310 rows=557 loops=1)

  • Join Filter: (po.dictionary_position_id = dp.id)
5. 0.489 16.123 ↓ 185.7 557 1

Nested Loop (cost=23.56..70.33 rows=3 width=265) (actual time=0.277..16.123 rows=557 loops=1)

6. 0.175 12.292 ↓ 139.2 557 1

Nested Loop (cost=23.14..68.06 rows=4 width=272) (actual time=0.262..12.292 rows=557 loops=1)

7. 0.351 5.990 ↓ 111.4 557 1

Nested Loop (cost=23.14..64.05 rows=5 width=272) (actual time=0.237..5.990 rows=557 loops=1)

8. 0.351 3.197 ↓ 152.6 1,221 1

Nested Loop (cost=22.72..60.04 rows=8 width=256) (actual time=0.225..3.197 rows=1,221 loops=1)

9. 0.089 1.379 ↓ 163.0 163 1

Nested Loop (cost=22.29..34.34 rows=1 width=252) (actual time=0.212..1.379 rows=163 loops=1)

10. 0.463 0.638 ↓ 163.0 163 1

Bitmap Heap Scan on nsi_price_order p (cost=21.87..25.89 rows=1 width=110) (actual time=0.198..0.638 rows=163 loops=1)

  • Recheck Cond: ((date_sent >= '2019-04-08 00:00:00+03'::timestamp with time zone) AND (date_sent <= '2019-04-08 23:59:59+03'::timestamp with time zone) AND (status = 2))
  • Filter: ((only_list_email IS FALSE) AND (out_system_supplier IS NULL))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=156
11. 0.013 0.175 ↓ 0.0 0 1

BitmapAnd (cost=21.87..21.87 rows=1 width=0) (actual time=0.175..0.175 rows=0 loops=1)

12. 0.050 0.050 ↓ 2.0 179 1

Bitmap Index Scan on nsi_price_order_date_sent_idx (cost=0.00..5.18 rows=89 width=0) (actual time=0.050..0.050 rows=179 loops=1)

  • Index Cond: ((date_sent >= '2019-04-08 00:00:00+03'::timestamp with time zone) AND (date_sent <= '2019-04-08 23:59:59+03'::timestamp with time zone))
13. 0.112 0.112 ↓ 1.1 607 1

Bitmap Index Scan on nsi_price_order_status_idx (cost=0.00..16.44 rows=553 width=0) (actual time=0.112..0.112 rows=607 loops=1)

  • Index Cond: (status = 2)
14. 0.652 0.652 ↑ 1.0 1 163

Index Scan using contragents_pkey on contragents co (cost=0.42..8.44 rows=1 width=146) (actual time=0.004..0.004 rows=1 loops=163)

  • Index Cond: (id = p.customer_id)
15. 1.467 1.467 ↑ 3.3 7 163

Index Scan using nsi_price_order_positions_order_id_idx_btree on nsi_price_order_positions po (cost=0.42..25.47 rows=23 width=8) (actual time=0.004..0.009 rows=7 loops=163)

  • Index Cond: (price_order_id = p.id)
16. 2.442 2.442 ↓ 0.0 0 1,221

Index Scan using nsi_dictionary_position_category_dictionary_position_id_idx on nsi_dictionary_position_category dpc (cost=0.42..0.49 rows=1 width=16) (actual time=0.002..0.002 rows=0 loops=1,221)

  • Index Cond: (dictionary_position_id = po.dictionary_position_id)
17. 1.114 6.127 ↑ 3.0 1 557

Append (cost=0.00..0.77 rows=3 width=53) (actual time=0.008..0.011 rows=1 loops=557)

18. 0.000 0.000 ↓ 0.0 0 557

Seq Scan on nsi_partitional_category ca (cost=0.00..0.00 rows=1 width=114) (actual time=0.000..0.000 rows=0 loops=557)

  • Filter: ((okdp2 IS NOT NULL) AND ((dpc.category_code)::text = (code)::text) AND (dpc.classifier_type = classifier_type_id))
19. 3.899 3.899 ↑ 1.0 1 557

Index Scan using nsi_partitional_category_1_code_idx on nsi_partitional_category_1 ca_1 (cost=0.41..0.47 rows=1 width=24) (actual time=0.007..0.007 rows=1 loops=557)

  • Index Cond: ((code)::text = (dpc.category_code)::text)
  • Filter: ((okdp2 IS NOT NULL) AND (dpc.classifier_type = classifier_type_id))
20. 1.114 1.114 ↓ 0.0 0 557

Index Scan using nsi_partitional_category_2_code_idx on nsi_partitional_category_2 ca_2 (cost=0.28..0.30 rows=1 width=21) (actual time=0.002..0.002 rows=0 loops=557)

  • Index Cond: ((code)::text = (dpc.category_code)::text)
  • Filter: ((okdp2 IS NOT NULL) AND (dpc.classifier_type = classifier_type_id))
21. 3.342 3.342 ↑ 1.0 1 557

Index Scan using vocab_okdp2_idx_code on vocab_okdp2 vb2 (cost=0.41..0.56 rows=1 width=17) (actual time=0.006..0.006 rows=1 loops=557)

  • Index Cond: ((code)::text = (ca.okdp2)::text)
22. 2.785 2.785 ↑ 1.0 1 557

Index Only Scan using nsi_dictionary_position_pkey on nsi_dictionary_position dp (cost=0.42..0.67 rows=1 width=4) (actual time=0.004..0.005 rows=1 loops=557)

  • Index Cond: (id = dpc.dictionary_position_id)
  • Heap Fetches: 565
23. 1.407 12.088 ↓ 571.5 1,143 1

Nested Loop (cost=23.13..61.77 rows=2 width=257) (actual time=0.208..12.088 rows=1,143 loops=1)

24. 0.140 2.680 ↓ 285.8 1,143 1

Nested Loop (cost=22.72..59.91 rows=4 width=261) (actual time=0.195..2.680 rows=1,143 loops=1)

25. 0.148 1.073 ↓ 163.0 163 1

Nested Loop (cost=22.29..34.34 rows=1 width=252) (actual time=0.189..1.073 rows=163 loops=1)

26. 0.274 0.436 ↓ 163.0 163 1

Bitmap Heap Scan on nsi_price_order p_1 (cost=21.87..25.89 rows=1 width=110) (actual time=0.180..0.436 rows=163 loops=1)

  • Recheck Cond: ((date_sent >= '2019-04-08 00:00:00+03'::timestamp with time zone) AND (date_sent <= '2019-04-08 23:59:59+03'::timestamp with time zone) AND (status = 2))
  • Filter: ((only_list_email IS FALSE) AND (out_system_supplier IS NULL))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=156
27. 0.012 0.162 ↓ 0.0 0 1

BitmapAnd (cost=21.87..21.87 rows=1 width=0) (actual time=0.162..0.162 rows=0 loops=1)

28. 0.034 0.034 ↓ 2.0 179 1

Bitmap Index Scan on nsi_price_order_date_sent_idx (cost=0.00..5.18 rows=89 width=0) (actual time=0.034..0.034 rows=179 loops=1)

  • Index Cond: ((date_sent >= '2019-04-08 00:00:00+03'::timestamp with time zone) AND (date_sent <= '2019-04-08 23:59:59+03'::timestamp with time zone))
29. 0.116 0.116 ↓ 1.1 607 1

Bitmap Index Scan on nsi_price_order_status_idx (cost=0.00..16.44 rows=553 width=0) (actual time=0.116..0.116 rows=607 loops=1)

  • Index Cond: (status = 2)
30. 0.489 0.489 ↑ 1.0 1 163

Index Scan using contragents_pkey on contragents co_1 (cost=0.42..8.44 rows=1 width=146) (actual time=0.003..0.003 rows=1 loops=163)

  • Index Cond: (id = p_1.customer_id)
31. 1.467 1.467 ↑ 1.4 7 163

Index Scan using nsi_price_order_positions_order_id_idx_btree on nsi_price_order_positions po_1 (cost=0.42..25.47 rows=10 width=13) (actual time=0.004..0.009 rows=7 loops=163)

  • Index Cond: (price_order_id = p_1.id)
  • Filter: (okpd2 IS NOT NULL)
  • Rows Removed by Filter: 0
32. 8.001 8.001 ↑ 1.0 1 1,143

Index Scan using vocab_okdp2_idx_code on vocab_okdp2 vb2_1 (cost=0.41..0.45 rows=1 width=17) (actual time=0.007..0.007 rows=1 loops=1,143)

  • Index Cond: ((code)::text = (po_1.okpd2)::text)