explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DHbf

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 5,390.725 ↓ 0.0 0 1

Subquery Scan on z (cost=1,038,426.42..1,038,485.38 rows=1 width=1,283) (actual time=5,390.725..5,390.725 rows=0 loops=1)

2. 0.035 5,390.725 ↓ 0.0 0 1

Sort (cost=1,038,426.42..1,038,426.43 rows=1 width=919) (actual time=5,390.725..5,390.725 rows=0 loops=1)

  • Sort Key: ((SubPlan 8)), ((SubPlan 9)), x.fatura_dt DESC, x.t_skys_uretim_tuketim, x.tahsil_dt
  • Sort Method: quicksort Memory: 25kB
3. 0.002 5,390.690 ↓ 0.0 0 1

WindowAgg (cost=509,162.13..1,038,426.41 rows=1 width=919) (actual time=5,390.690..5,390.690 rows=0 loops=1)

4. 45.618 5,390.688 ↓ 0.0 0 1

Subquery Scan on x (cost=509,162.13..1,038,409.80 rows=1 width=433) (actual time=5,390.688..5,390.688 rows=0 loops=1)

  • Filter: (((x.fatura_no)::text <> 'IADE'::text) AND ((x.kullanici_ad)::text >= '000%'::text) AND ((x.kullanici_ad)::text <= 'zzz%'::text) AND (x.t_skys_fatura_cins = 1) AND (x.fatura_ay = 1) AND (x.fatura_yil = 2020))
  • Rows Removed by Filter: 17200
5. 67.380 5,345.070 ↑ 1.1 17,200 1

WindowAgg (cost=509,162.13..1,037,944.65 rows=18,606 width=465) (actual time=2,073.372..5,345.070 rows=17,200 loops=1)

6. 344.208 2,078.490 ↑ 1.1 17,200 1

Sort (cost=509,162.13..509,208.65 rows=18,606 width=425) (actual time=2,073.184..2,078.490 rows=17,200 loops=1)

  • Sort Key: ("right"(("*SELECT* 1".fatura_no)::text, 13)), x2.fatura_tahsil_id
  • Sort Method: quicksort Memory: 5240kB
7. 27.541 1,734.282 ↑ 1.1 17,200 1

Hash Left Join (cost=35,661.07..507,842.64 rows=18,606 width=425) (actual time=1,147.275..1,734.282 rows=17,200 loops=1)

  • Hash Cond: ("*SELECT* 1".fatura_id = x2.fatura_id)
8. 6.066 1,706.231 ↑ 1.1 17,188 1

Hash Join (cost=35,627.01..507,438.49 rows=18,336 width=102) (actual time=1,146.740..1,706.231 rows=17,188 loops=1)

  • Hash Cond: ("*SELECT* 1".kullanici_id = kk.kullanici_id)
9. 112.104 1,699.476 ↑ 1.1 17,188 1

Hash Left Join (cost=35,539.04..507,098.40 rows=18,336 width=58) (actual time=1,146.038..1,699.476 rows=17,188 loops=1)

  • Hash Cond: (("*SELECT* 1".fatura_no)::text = (mf.fatura_no)::text)
10. 1.957 443.246 ↑ 1.1 17,188 1

Append (cost=113.99..468,334.62 rows=18,084 width=50) (actual time=0.871..443.246 rows=17,188 loops=1)

11. 2.696 411.853 ↑ 1.1 16,077 1

Subquery Scan on *SELECT* 1 (cost=113.99..467,657.04 rows=17,236 width=50) (actual time=0.869..411.853 rows=16,077 loops=1)

12. 19.225 409.157 ↑ 1.1 16,077 1

Hash Semi Join (cost=113.99..467,484.68 rows=17,236 width=220) (actual time=0.869..409.157 rows=16,077 loops=1)

  • Hash Cond: (y.kullanici_id = k1.kullanici_id)
13. 51.523 51.523 ↑ 1.0 17,201 1

Seq Scan on skys_fatura y (cost=0.00..553.36 rows=17,236 width=46) (actual time=0.011..51.523 rows=17,201 loops=1)

14. 0.147 0.792 ↓ 1.0 1,002 1

Hash (cost=101.72..101.72 rows=981 width=4) (actual time=0.792..0.792 rows=1,002 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 44kB
15. 0.319 0.645 ↓ 1.0 1,002 1

HashAggregate (cost=82.10..91.91 rows=981 width=4) (actual time=0.543..0.645 rows=1,002 loops=1)

  • Group Key: k1.kullanici_id
16. 0.326 0.326 ↓ 1.0 1,002 1

Seq Scan on skys_kullanici k1 (cost=0.00..79.65 rows=981 width=4) (actual time=0.006..0.326 rows=1,002 loops=1)

  • Filter: ((active_flag = 1) AND (t_fatura_basim_turu = 1))
  • Rows Removed by Filter: 128
17.          

SubPlan (for Hash Semi Join)

18. 0.000 337.617 ↑ 8.0 1 16,077

Unique (cost=27.03..27.07 rows=8 width=4) (actual time=0.021..0.021 rows=1 loops=16,077)

19. 112.539 337.617 ↑ 8.0 1 16,077

Sort (cost=27.03..27.05 rows=8 width=4) (actual time=0.021..0.021 rows=1 loops=16,077)

  • Sort Key: fd.tesis_id
  • Sort Method: quicksort Memory: 25kB
20. 225.078 225.078 ↑ 8.0 1 16,077

Index Scan using idx_fatura_detay_active_flag on skys_fatura_detay fd (cost=0.42..26.91 rows=8 width=4) (actual time=0.011..0.014 rows=1 loops=16,077)

  • Index Cond: (fatura_id = y.fatura_id)
21. 0.155 29.436 ↓ 1.3 1,111 1

Subquery Scan on *SELECT* 2 (cost=61.06..677.58 rows=848 width=50) (actual time=0.115..29.436 rows=1,111 loops=1)

22. 1.669 29.281 ↓ 1.3 1,111 1

Hash Semi Join (cost=61.06..669.10 rows=848 width=220) (actual time=0.114..29.281 rows=1,111 loops=1)

  • Hash Cond: (y_1.kullanici_id = k1_1.kullanici_id)
23. 27.524 27.524 ↑ 1.0 17,201 1

Seq Scan on skys_fatura y_1 (cost=0.00..553.36 rows=17,236 width=46) (actual time=0.006..27.524 rows=17,201 loops=1)

24. 0.004 0.088 ↑ 1.0 32 1

Hash (cost=60.65..60.65 rows=33 width=4) (actual time=0.088..0.088 rows=32 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
25. 0.019 0.084 ↑ 1.0 32 1

HashAggregate (cost=59.99..60.32 rows=33 width=4) (actual time=0.079..0.084 rows=32 loops=1)

  • Group Key: k1_1.kullanici_id
26. 0.065 0.065 ↑ 1.0 32 1

Index Scan using idx_active_flag_basim_turu on skys_kullanici k1_1 (cost=0.28..59.91 rows=33 width=4) (actual time=0.038..0.065 rows=32 loops=1)

  • Index Cond: ((t_fatura_basim_turu = 2) AND (active_flag = 1))
27. 194.927 1,144.126 ↓ 1.0 305,617 1

Hash (cost=29,547.58..29,547.58 rows=303,958 width=25) (actual time=1,144.126..1,144.126 rows=305,617 loops=1)

  • Buckets: 262144 Batches: 2 Memory Usage: 10139kB
28. 949.199 949.199 ↓ 1.0 305,638 1

Seq Scan on muh_fatura mf (cost=0.00..29,547.58 rows=303,958 width=25) (actual time=0.014..949.199 rows=305,638 loops=1)

29. 0.253 0.689 ↓ 1.0 1,130 1

Hash (cost=74.10..74.10 rows=1,110 width=48) (actual time=0.688..0.689 rows=1,130 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 107kB
30. 0.436 0.436 ↓ 1.0 1,130 1

Seq Scan on skys_kullanici kk (cost=0.00..74.10 rows=1,110 width=48) (actual time=0.008..0.436 rows=1,130 loops=1)

31. 0.266 0.510 ↑ 1.0 757 1

Hash (cost=24.58..24.58 rows=758 width=291) (actual time=0.510..0.510 rows=757 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 95kB
32. 0.244 0.244 ↑ 1.0 757 1

Seq Scan on skys_fatura_tahsil x2 (cost=0.00..24.58 rows=758 width=291) (actual time=0.013..0.244 rows=757 loops=1)

33.          

SubPlan (for WindowAgg)

34. 0.000 3,199.200 ↑ 1.0 1 17,200

Aggregate (cost=28.38..28.39 rows=1 width=32) (actual time=0.186..0.186 rows=1 loops=17,200)

35. 3,199.200 3,199.200 ↓ 0.0 0 17,200

Seq Scan on skys_fatura_tahsil ft (cost=0.00..28.37 rows=1 width=8) (actual time=0.181..0.186 rows=0 loops=17,200)

  • Filter: ((tahsil_dt <= x2.tahsil_dt) AND (fatura_id = x2.fatura_id))
  • Rows Removed by Filter: 757
36.          

SubPlan (for WindowAgg)

37. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_kullanici on skys_kullanici k (cost=0.28..8.29 rows=1 width=44) (never executed)

  • Index Cond: (kullanici_id = x.kullanici_id)
38. 0.000 0.000 ↓ 0.0 0

Index Scan using tesis_id_active_flag_t_tesis_tur_id_idx on skys_tesis t (cost=0.28..8.30 rows=1 width=14) (never executed)

  • Index Cond: (tesis_id = x.tesis_id)
39.          

SubPlan (for Subquery Scan)

40. 0.000 0.000 ↓ 0.0 0

Limit (cost=8.46..8.47 rows=1 width=8) (never executed)

41. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=8.46..8.47 rows=1 width=8) (never executed)

42. 0.000 0.000 ↓ 0.0 0

Index Scan using w5_file_attachment_table_id_table_pk_idx on w5_file_attachment cx (cost=0.43..8.45 rows=1 width=0) (never executed)

  • Index Cond: ((table_id = 2706) AND ((table_pk)::text = (z.pkpkpk_id)::text))
  • Filter: (customization_id = 0)
43. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.43..16.52 rows=1 width=32) (never executed)

44. 0.000 0.000 ↓ 0.0 0

Index Scan using w5_comment_summary_pkey on w5_comment_summary cx_1 (cost=0.15..8.17 rows=1 width=528) (never executed)

  • Index Cond: ((table_id = 2706) AND ((table_pk)::text = (z.pkpkpk_id)::text) AND (customization_id = 0))
45. 0.000 0.000 ↓ 0.0 0

Index Scan using w5_comment_pkey on w5_comment cxx (cost=0.29..8.31 rows=1 width=30) (never executed)

  • Index Cond: ((comment_id = cx_1.last_comment_id) AND (customization_id = 0))
46. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_kullanici on skys_kullanici x_1 (cost=0.28..8.29 rows=1 width=44) (never executed)

  • Index Cond: (kullanici_id = z.kullanici_id)
47. 0.000 0.000 ↓ 0.0 0

Index Scan using tesis_id_active_flag_t_tesis_tur_id_idx on skys_tesis x_2 (cost=0.28..8.30 rows=1 width=14) (never executed)

  • Index Cond: (tesis_id = z.tesis_id)
48. 0.000 0.000 ↓ 0.0 0

Seq Scan on t_skys_uretim_tuketim x_3 (cost=0.00..1.02 rows=1 width=108) (never executed)

  • Filter: (uretim_tuketim_id = z.t_skys_uretim_tuketim)
49. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_fatura_cins on t_skys_fatura_cins x_4 (cost=0.15..8.17 rows=1 width=108) (never executed)

  • Index Cond: (fatura_cins_id = z.t_skys_fatura_cins)
50. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_tahsilat_sure_durum on t_skys_tahsilat_sure_durum x_5 (cost=0.15..8.17 rows=1 width=108) (never executed)

  • Index Cond: (tahsilat_sure_durum_id = z.t_skys_tahsilat_sure_durum)
Planning time : 5.569 ms
Execution time : 5,391.826 ms