explain.depesz.com

PostgreSQL's explain analyze made readable

Result: VFAs

Settings
# exclusive inclusive rows x rows loops node
1. 0.052 50,149.031 ↑ 1.0 10 1

Limit (cost=1,560,742.20..1,561,662.11 rows=10 width=607) (actual time=50,148.808..50,149.031 rows=10 loops=1)

2. 0.080 50,148.979 ↑ 69.8 10 1

Result (cost=1,560,742.20..1,624,951.66 rows=698 width=607) (actual time=50,148.804..50,148.979 rows=10 loops=1)

3. 0.109 50,148.717 ↑ 69.8 10 1

Sort (cost=1,560,742.20..1,560,743.95 rows=698 width=510) (actual time=50,148.712..50,148.717 rows=10 loops=1)

  • Sort Key: d.ck_id
  • Sort Method: top-N heapsort Memory: 29kB
4. 0.404 50,148.608 ↑ 6.6 105 1

WindowAgg (cost=1,323,557.50..1,560,727.12 rows=698 width=510) (actual time=50,148.398..50,148.608 rows=105 loops=1)

5. 6.275 50,148.204 ↑ 6.6 105 1

Nested Loop (cost=1,323,557.50..1,560,711.42 rows=698 width=446) (actual time=43,673.837..50,148.204 rows=105 loops=1)

  • Join Filter: (a.ck_department = dep.ck_id)
  • Rows Removed by Join Filter: 13230
6. 0.238 50,136.154 ↑ 6.6 105 1

Nested Loop (cost=1,323,557.50..1,559,260.62 rows=698 width=411) (actual time=43,673.577..50,136.154 rows=105 loops=1)

7. 0.193 50,135.706 ↑ 6.6 105 1

Nested Loop (cost=1,323,557.07..1,558,858.63 rows=698 width=411) (actual time=43,673.561..50,135.706 rows=105 loops=1)

8. 6,480.902 50,135.093 ↑ 6.6 105 1

Hash Join (cost=1,323,556.65..1,558,551.20 rows=698 width=403) (actual time=43,673.535..50,135.093 rows=105 loops=1)

  • Hash Cond: (d.ck_id = cdr.ck_document)
9. 0.616 4.598 ↑ 6.6 105 1

Group (cost=7,448.15..51,922.97 rows=698 width=395) (actual time=3.203..4.598 rows=105 loops=1)

  • Group Key: d.ck_id, c_1.cn_number, dt.cv_name, c_1.cl_confidential
10. 0.377 3.142 ↑ 6.6 105 1

Sort (cost=7,448.15..7,449.90 rows=698 width=159) (actual time=3.092..3.142 rows=105 loops=1)

  • Sort Key: d.ck_id, c_1.cn_number, dt.cv_name, c_1.cl_confidential
  • Sort Method: quicksort Memory: 45kB
11. 0.320 2.765 ↑ 6.6 105 1

Hash Join (cost=4.91..7,415.18 rows=698 width=159) (actual time=0.355..2.765 rows=105 loops=1)

  • Hash Cond: (d.ck_document_type = dt.ck_id)
12. 0.267 2.193 ↑ 6.6 105 1

Nested Loop (cost=1.43..7,409.74 rows=698 width=76) (actual time=0.085..2.193 rows=105 loops=1)

13. 0.031 0.031 ↑ 1.0 1 1

Index Scan using contract_legal_pkey on contract c_1 (cost=0.42..8.44 rows=1 width=17) (actual time=0.028..0.031 rows=1 loops=1)

  • Index Cond: (ck_id = 61326)
14. 0.471 1.895 ↑ 6.6 105 1

Nested Loop (cost=1.00..7,394.32 rows=698 width=75) (actual time=0.050..1.895 rows=105 loops=1)

15. 0.374 0.374 ↑ 6.6 105 1

Index Scan using contract_document_rel_idx on contract_document_rel cdr_1 (cost=0.56..1,498.99 rows=698 width=16) (actual time=0.023..0.374 rows=105 loops=1)

  • Index Cond: (ck_contract = 61326)
16. 1.050 1.050 ↑ 1.0 1 105

Index Scan using document_pkey on document d (cost=0.44..8.45 rows=1 width=67) (actual time=0.010..0.010 rows=1 loops=105)

  • Index Cond: (ck_id = cdr_1.ck_document)
17. 0.141 0.252 ↑ 1.0 66 1

Hash (cost=2.66..2.66 rows=66 width=99) (actual time=0.251..0.252 rows=66 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 17kB
18. 0.111 0.111 ↑ 1.0 66 1

Seq Scan on document_type_dict dt (cost=0.00..2.66 rows=66 width=99) (actual time=0.016..0.111 rows=66 loops=1)

19.          

SubPlan (for Group)

20. 0.210 0.420 ↑ 1.0 1 105

Aggregate (cost=31.83..31.84 rows=1 width=32) (actual time=0.003..0.004 rows=1 loops=105)

21. 0.210 0.210 ↓ 0.0 0 105

Sort (cost=31.81..31.81 rows=1 width=36) (actual time=0.002..0.002 rows=0 loops=105)

  • Sort Key: da.cd_period
  • Sort Method: quicksort Memory: 25kB
22. 0.000 0.000 ↓ 0.0 0 105

Seq Scan on document_arrear da (cost=0.00..31.80 rows=1 width=36) (actual time=0.000..0.000 rows=0 loops=105)

  • Filter: ((ck_document = d.ck_id) AND (cn_code = 1))
23. 0.210 0.420 ↑ 1.0 1 105

Aggregate (cost=31.83..31.84 rows=1 width=32) (actual time=0.003..0.004 rows=1 loops=105)

24. 0.105 0.210 ↓ 0.0 0 105

Sort (cost=31.81..31.81 rows=1 width=36) (actual time=0.002..0.002 rows=0 loops=105)

  • Sort Key: da_1.cd_period
  • Sort Method: quicksort Memory: 25kB
25. 0.105 0.105 ↓ 0.0 0 105

Seq Scan on document_arrear da_1 (cost=0.00..31.80 rows=1 width=36) (actual time=0.001..0.001 rows=0 loops=105)

  • Filter: ((ck_document = d.ck_id) AND (cn_code = 2))
26. 22,076.450 43,649.593 ↑ 1.0 38,993,000 1

Hash (cost=638,300.00..638,300.00 rows=38,993,000 width=16) (actual time=43,649.592..43,649.593 rows=38,993,000 loops=1)

  • Buckets: 16777216 Batches: 8 Memory Usage: 359404kB
27. 21,573.143 21,573.143 ↑ 1.0 38,993,000 1

Seq Scan on contract_document_rel cdr (cost=0.00..638,300.00 rows=38,993,000 width=16) (actual time=0.016..21,573.143 rows=38,993,000 loops=1)

28. 0.420 0.420 ↑ 1.0 1 105

Index Scan using contract_legal_pkey on contract c (cost=0.42..0.44 rows=1 width=24) (actual time=0.004..0.004 rows=1 loops=105)

  • Index Cond: (ck_id = cdr.ck_contract)
29. 0.210 0.210 ↑ 1.0 1 105

Index Scan using abonent_pkey on abonent a (cost=0.42..0.58 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=105)

  • Index Cond: (ck_id = c.ck_abonent)
30. 5.701 5.775 ↑ 1.1 127 105

Materialize (cost=0.00..6.09 rows=139 width=51) (actual time=0.001..0.055 rows=127 loops=105)

31. 0.074 0.074 ↑ 1.1 127 1

Seq Scan on department dep (cost=0.00..5.39 rows=139 width=51) (actual time=0.006..0.074 rows=127 loops=1)

32.          

SubPlan (for Result)

33. 0.020 0.080 ↑ 1.0 1 10

Aggregate (cost=50.14..50.15 rows=1 width=32) (actual time=0.007..0.008 rows=1 loops=10)

34. 0.030 0.060 ↓ 0.0 0 10

Hash Join (cost=29.73..50.12 rows=8 width=32) (actual time=0.005..0.006 rows=0 loops=10)

  • Hash Cond: (l.ck_id = dlr.ck_lawsuit)
35. 0.010 0.010 ↑ 750.0 1 1

Seq Scan on lawsuit l (cost=0.00..17.50 rows=750 width=40) (actual time=0.010..0.010 rows=1 loops=1)

36. 0.010 0.020 ↓ 0.0 0 10

Hash (cost=29.62..29.62 rows=8 width=8) (actual time=0.002..0.002 rows=0 loops=10)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
37. 0.010 0.010 ↓ 0.0 0 10

Seq Scan on document_lawsuit_rel dlr (cost=0.00..29.62 rows=8 width=8) (actual time=0.001..0.001 rows=0 loops=10)

  • Filter: (ck_document = d.ck_id)
38. 0.010 0.020 ↑ 1.0 1 10

Aggregate (cost=29.64..29.66 rows=1 width=32) (actual time=0.002..0.002 rows=1 loops=10)

39. 0.010 0.010 ↓ 0.0 0 10

Seq Scan on stop_list s (cost=0.00..29.62 rows=8 width=8) (actual time=0.001..0.001 rows=0 loops=10)

  • Filter: (ck_document = d.ck_id)
40. 0.000 0.000 ↓ 0.0 0

Seq Scan on stop_list s_1 (cost=0.00..29.62 rows=8 width=0) (never executed)

  • Filter: (ck_document = d.ck_id)
41. 0.002 0.002 ↓ 0.0 0 1

Seq Scan on stop_list s_2 (cost=0.00..25.70 rows=1,570 width=8) (actual time=0.001..0.002 rows=0 loops=1)

42. 0.080 0.080 ↑ 1.0 1 10

Index Scan using document_pkey on document d1 (cost=0.44..8.46 rows=1 width=1) (actual time=0.007..0.008 rows=1 loops=10)

  • Index Cond: (ck_id = d.ck_id)
Planning time : 3.902 ms
Execution time : 50,150.830 ms