explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4A7

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 442,499.253 ↑ 1.4 70 1

Limit (cost=17,026,839.90..17,026,845.65 rows=100 width=193) (actual time=442,499.193..442,499.253 rows=70 loops=1)

2. 0.049 442,499.248 ↑ 36.0 70 1

Unique (cost=17,026,839.90..17,026,984.92 rows=2,522 width=193) (actual time=442,499.192..442,499.248 rows=70 loops=1)

3. 0.330 442,499.199 ↑ 36.0 70 1

Sort (cost=17,026,839.90..17,026,846.21 rows=2,522 width=193) (actual time=442,499.190..442,499.199 rows=70 loops=1)

  • Sort Key: s.uuid, d.external_id, d.sked_number, d.date, s.date_of_sending, s.date_of_meeting, s.planned_date_of_meeting, s.waybill_number, s.branch_to_code, s.carrier_code, s.transport_type_code, s.flight_code, d.date_closed, d.number, d.description, s.fact_weight, s.volume, amount_weight.cargo_place_amount, amount_weight.design_weight, (count(*)), sync_problem.uuid, (bool_or(cpc.urgent))
  • Sort Method: quicksort Memory: 43kB
4. 0.256 442,498.869 ↑ 36.0 70 1

Nested Loop Left Join (cost=6,646.84..17,026,697.41 rows=2,522 width=193) (actual time=6,695.327..442,498.869 rows=70 loops=1)

5. 0.297 442,494.483 ↑ 36.0 70 1

Nested Loop Left Join (cost=3.67..272,538.73 rows=2,522 width=208) (actual time=6,695.295..442,494.483 rows=70 loops=1)

6. 0.426 442,471.856 ↓ 70.0 70 1

Nested Loop Left Join (cost=1.96..200,731.06 rows=1 width=208) (actual time=6,695.205..442,471.856 rows=70 loops=1)

7. 1,293.233 442,469.750 ↓ 70.0 70 1

Nested Loop Left Join (cost=1.41..200,700.83 rows=1 width=192) (actual time=6,695.182..442,469.750 rows=70 loops=1)

  • Join Filter: (sync_sked.document_uuid = s.uuid)
  • Rows Removed by Join Filter: 20,341,026
8. 0.230 103.787 ↓ 70.0 70 1

Nested Loop Left Join (cost=0.85..625.65 rows=1 width=184) (actual time=19.999..103.787 rows=70 loops=1)

9. 0.000 102.927 ↓ 70.0 70 1

Nested Loop (cost=0.43..624.03 rows=1 width=174) (actual time=19.984..102.927 rows=70 loops=1)

10. 0.169 94.802 ↓ 12.2 1,376 1

Append (cost=0.00..324.86 rows=113 width=73) (actual time=0.250..94.802 rows=1,376 loops=1)

11. 0.015 0.015 ↓ 0.0 0 1

Seq Scan on document_p2018_11 d (cost=0.00..1.16 rows=1 width=73) (actual time=0.015..0.015 rows=0 loops=1)

  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND (date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date) AND ((type)::text = 'SHIPMENT'::text))
  • Rows Removed by Filter: 9
12. 0.010 0.010 ↓ 0.0 0 1

Index Scan using document_p2018_12_date_idx on document_p2018_12 d_1 (cost=0.28..2.50 rows=1 width=65) (actual time=0.010..0.010 rows=0 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
13. 0.004 0.004 ↓ 0.0 0 1

Index Scan using document_p2019_01_date_idx on document_p2019_01 d_2 (cost=0.29..2.51 rows=1 width=66) (actual time=0.004..0.004 rows=0 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
14. 0.007 0.007 ↓ 0.0 0 1

Index Scan using document_p2019_02_date_idx on document_p2019_02 d_3 (cost=0.29..2.51 rows=1 width=67) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
15. 0.004 0.004 ↓ 0.0 0 1

Index Scan using document_p2019_03_date_idx on document_p2019_03 d_4 (cost=0.29..2.51 rows=1 width=66) (actual time=0.004..0.004 rows=0 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
16. 0.005 0.005 ↓ 0.0 0 1

Index Scan using document_p2019_04_date_idx on document_p2019_04 d_5 (cost=0.29..2.51 rows=1 width=67) (actual time=0.005..0.005 rows=0 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
17. 0.005 0.005 ↓ 0.0 0 1

Index Scan using document_p2019_05_date_idx on document_p2019_05 d_6 (cost=0.29..2.52 rows=1 width=67) (actual time=0.005..0.005 rows=0 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
18. 0.007 0.007 ↓ 0.0 0 1

Index Scan using document_p2019_06_date_idx on document_p2019_06 d_7 (cost=0.42..2.96 rows=1 width=66) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
19. 0.006 0.006 ↓ 0.0 0 1

Index Scan using document_p2019_07_date_idx on document_p2019_07 d_8 (cost=0.42..2.64 rows=1 width=66) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
20. 0.007 0.007 ↓ 0.0 0 1

Index Scan using document_p2019_08_date_idx on document_p2019_08 d_9 (cost=0.42..2.64 rows=1 width=66) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
21. 0.007 0.007 ↓ 0.0 0 1

Index Scan using document_p2019_09_date_idx on document_p2019_09 d_10 (cost=0.42..2.65 rows=1 width=67) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
22. 0.007 0.007 ↓ 0.0 0 1

Index Scan using document_p2019_10_date_idx on document_p2019_10 d_11 (cost=0.43..10.19 rows=5 width=68) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
23. 0.007 0.007 ↓ 0.0 0 1

Index Scan using document_p2019_11_date_idx on document_p2019_11 d_12 (cost=0.43..15.79 rows=8 width=75) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
24. 0.007 0.007 ↓ 0.0 0 1

Index Scan using document_p2019_12_date_idx on document_p2019_12 d_13 (cost=0.43..16.24 rows=7 width=69) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
25. 0.007 0.007 ↓ 0.0 0 1

Index Scan using document_p2020_01_date_idx on document_p2020_01 d_14 (cost=0.43..14.04 rows=7 width=69) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
26. 0.006 0.006 ↓ 0.0 0 1

Index Scan using document_p2020_02_date_idx on document_p2020_02 d_15 (cost=0.43..15.41 rows=8 width=69) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
27. 0.007 0.007 ↓ 0.0 0 1

Index Scan using document_p2020_03_date_idx on document_p2020_03 d_16 (cost=0.43..11.38 rows=6 width=69) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
28. 0.008 0.008 ↓ 0.0 0 1

Index Scan using document_p2020_04_date_idx on document_p2020_04 d_17 (cost=0.43..12.78 rows=7 width=69) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
29. 0.006 0.006 ↓ 0.0 0 1

Index Scan using document_p2020_05_date_idx on document_p2020_05 d_18 (cost=0.43..24.44 rows=8 width=70) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
30. 0.007 0.007 ↓ 0.0 0 1

Index Scan using document_p2020_06_date_idx on document_p2020_06 d_19 (cost=0.43..28.09 rows=9 width=71) (actual time=0.006..0.007 rows=0 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
31. 0.007 0.007 ↓ 0.0 0 1

Index Scan using document_p2020_07_date_idx on document_p2020_07 d_20 (cost=0.43..35.44 rows=10 width=73) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
32. 0.008 0.008 ↓ 0.0 0 1

Index Scan using document_p2020_08_date_idx on document_p2020_08 d_21 (cost=0.43..30.52 rows=9 width=74) (actual time=0.007..0.008 rows=0 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
33. 0.008 0.008 ↓ 0.0 0 1

Index Scan using document_p2020_09_date_idx on document_p2020_09 d_22 (cost=0.43..60.80 rows=14 width=78) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
34. 94.465 94.465 ↓ 458.7 1,376 1

Index Scan using document_p2020_10_date_idx on document_p2020_10 d_23 (cost=0.43..19.71 rows=3 width=81) (actual time=0.084..94.465 rows=1,376 loops=1)

  • Index Cond: ((date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND ((type)::text = 'SHIPMENT'::text))
  • Rows Removed by Filter: 87,241
35. 0.006 0.006 ↓ 0.0 0 1

Index Scan using document_p2020_11_type_idx on document_p2020_11 d_24 (cost=0.14..2.37 rows=1 width=204) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: ((type)::text = 'SHIPMENT'::text)
  • Filter: (((NOT deleted) OR (deleted IS NULL)) AND (date >= '2020-10-11'::date) AND (date <= '2020-10-11'::date))
36. 8.256 8.256 ↓ 0.0 0 1,376

Index Scan using shipment_pkey on shipment s (cost=0.43..2.65 rows=1 width=102) (actual time=0.006..0.006 rows=0 loops=1,376)

  • Index Cond: (uuid = d.uuid)
  • Filter: ((branch_from_code)::text = '424'::text)
  • Rows Removed by Filter: 1
37. 0.630 0.630 ↑ 1.0 1 70

Index Scan using pk_shipment_cargo_place_amount_and_weight_doc_uuid on shipment_cargo_place_amount_and_weight amount_weight (cost=0.43..1.62 rows=1 width=26) (actual time=0.009..0.009 rows=1 loops=70)

  • Index Cond: (document_uuid = s.uuid)
38. 9,325.680 441,072.730 ↓ 6.4 290,586 70

GroupAggregate (cost=0.55..199,055.48 rows=45,320 width=24) (actual time=0.049..6,301.039 rows=290,586 loops=70)

  • Group Key: sync_sked.document_uuid
39. 431,747.050 431,747.050 ↑ 1.0 967,971 70

Index Only Scan using sync_sked_doc_idx on sync_sked (cost=0.55..193,560.14 rows=1,008,427 width=16) (actual time=0.048..6,167.815 rows=967,971 loops=70)

  • Heap Fetches: 740,780,859
40. 1.680 1.680 ↑ 22.0 1 70

Index Scan using problem_doc_idx on problem sync_problem (cost=0.56..30.01 rows=22 width=32) (actual time=0.015..0.024 rows=1 loops=70)

  • Index Cond: (document_uuid = s.uuid)
  • Filter: ((operation_type)::text = 'SYNCHRONIZATION'::text)
41. 0.910 22.330 ↑ 2,522.0 1 70

GroupAggregate (cost=1.71..71,757.23 rows=2,522 width=48) (actual time=0.319..0.319 rows=1 loops=70)

  • Group Key: lnk.document_uuid
42. 0.928 21.420 ↑ 176.6 171 70

Nested Loop Left Join (cost=1.71..71,656.51 rows=30,200 width=16) (actual time=0.041..0.306 rows=171 loops=70)

43. 0.602 5.180 ↑ 130.0 7 70

Nested Loop (cost=1.13..6,824.60 rows=910 width=32) (actual time=0.027..0.074 rows=7 loops=70)

44. 1.330 1.330 ↑ 363.6 7 70

Index Only Scan using document_cargo_place_lnk_document_uuid_cargo_place_uuid_key on document_cargo_place_lnk lnk (cost=0.70..138.73 rows=2,545 width=32) (actual time=0.012..0.019 rows=7 loops=70)

  • Index Cond: (document_uuid = d.uuid)
  • Heap Fetches: 466
45. 3.248 3.248 ↑ 1.0 1 464

Index Scan using document_consolidation_cargo_place_uuid_idx on document_consolidation consolidation (cost=0.43..2.62 rows=1 width=32) (actual time=0.007..0.007 rows=1 loops=464)

  • Index Cond: (cargo_place_uuid = lnk.cargo_place_uuid)
46. 15.312 15.312 ↑ 97.9 26 464

Index Scan using doc_cp_lnk_document_uuid_idx on document_cargo_place_lnk consolidation_cargo_lnk (cost=0.57..45.79 rows=2,545 width=32) (actual time=0.010..0.033 rows=26 loops=464)

  • Index Cond: (document_uuid = consolidation.uuid)
47. 0.280 4.130 ↑ 1.0 1 70

Aggregate (cost=6,643.17..6,643.18 rows=1 width=1) (actual time=0.059..0.059 rows=1 loops=70)

48. 0.576 3.850 ↑ 62.3 7 70

Nested Loop (cost=1.13..6,642.08 rows=436 width=1) (actual time=0.017..0.055 rows=7 loops=70)

49. 0.490 0.490 ↑ 363.6 7 70

Index Only Scan using document_cargo_place_lnk_document_uuid_cargo_place_uuid_key on document_cargo_place_lnk lnk_1 (cost=0.70..138.73 rows=2,545 width=16) (actual time=0.005..0.007 rows=7 loops=70)

  • Index Cond: (document_uuid = d.uuid)
  • Heap Fetches: 466
50. 2.784 2.784 ↑ 1.0 1 464

Index Scan using cargo_place_consolidation_pkey on cargo_place_consolidation cpc (cost=0.43..2.56 rows=1 width=17) (actual time=0.006..0.006 rows=1 loops=464)

  • Index Cond: (uuid = lnk_1.cargo_place_uuid)
Planning time : 9.757 ms
Execution time : 442,499.753 ms