explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RiFx

Settings
# exclusive inclusive rows x rows loops node
1. 110.518 336,380.344 ↑ 138.7 2,373 1

Merge Join (cost=279,648.43..409,468.04 rows=329,062 width=202) (actual time=9,029.364..336,380.344 rows=2,373 loops=1)

  • Merge Cond: (b_mokejimu_sudengimai.ms_mokejimas = b_mokejimai.mok_id)
  • Join Filter: CASE WHEN (bool_or((padengimo_mokejimas.mok_budas = 20))) THEN (b_dokumentas.dok_id IS NOT NULL) ELSE true END
  • Rows Removed by Join Filter: 13
2. 238.944 2,314.866 ↑ 1.1 302,816 1

GroupAggregate (cost=72,862.67..79,647.45 rows=339,239 width=8) (actual time=1,881.665..2,314.866 rows=302,816 loops=1)

  • Group Key: b_mokejimu_sudengimai.ms_mokejimas
3. 684.281 2,075.922 ↑ 1.1 302,860 1

Sort (cost=72,862.67..73,710.76 rows=339,239 width=8) (actual time=1,881.647..2,075.922 rows=302,860 loops=1)

  • Sort Key: b_mokejimu_sudengimai.ms_mokejimas
  • Sort Method: external merge Disk: 5800kB
4. 659.357 1,391.641 ↑ 1.0 330,666 1

Hash Join (cost=21,791.34..37,059.27 rows=339,239 width=8) (actual time=551.081..1,391.641 rows=330,666 loops=1)

  • Hash Cond: (b_mokejimu_sudengimai.ms_padengimas = padengimo_mokejimas.mok_id)
5. 186.902 186.902 ↑ 1.0 330,666 1

Seq Scan on b_mokejimu_sudengimai (cost=0.00..5,823.39 rows=339,239 width=8) (actual time=0.007..186.902 rows=330,666 loops=1)

6. 250.091 545.382 ↑ 1.0 544,448 1

Hash (cost=12,855.93..12,855.93 rows=544,593 width=8) (actual time=545.382..545.382 rows=544,448 loops=1)

  • Buckets: 131072 Batches: 8 Memory Usage: 3685kB
7. 295.291 295.291 ↑ 1.0 544,448 1

Seq Scan on b_mokejimai padengimo_mokejimas (cost=0.00..12,855.93 rows=544,593 width=8) (actual time=0.213..295.291 rows=544,448 loops=1)

8. 14.289 333,954.960 ↓ 6.1 2,386 1

Materialize (cost=206,785.77..235,084.66 rows=388 width=213) (actual time=6,709.163..333,954.960 rows=2,386 loops=1)

9. 152,136.738 333,940.671 ↓ 6.1 2,386 1

Nested Loop Left Join (cost=206,785.77..235,083.69 rows=388 width=213) (actual time=6,709.151..333,940.671 rows=2,386 loops=1)

  • Join Filter: (bilieto_renginys.blt_pardavimas = b_pardavimai.pard_id)
  • Rows Removed by Join Filter: 787940710
10. 61.643 4,180.549 ↓ 6.1 2,386 1

Merge Join (cost=108,921.76..121,650.22 rows=388 width=205) (actual time=4,038.551..4,180.549 rows=2,386 loops=1)

  • Merge Cond: (b_mokejimu_sudengimai_1.ms_mokejimas = b_mokejimai.mok_id)
11. 1,561.521 3,794.136 ↑ 1.1 302,816 1

GroupAggregate (cost=85,907.86..94,388.84 rows=339,239 width=60) (actual time=1,950.289..3,794.136 rows=302,816 loops=1)

  • Group Key: b_mokejimu_sudengimai_1.ms_mokejimas
12. 761.267 2,232.615 ↑ 1.1 302,860 1

Sort (cost=85,907.86..86,755.96 rows=339,239 width=60) (actual time=1,950.057..2,232.615 rows=302,860 loops=1)

  • Sort Key: b_mokejimu_sudengimai_1.ms_mokejimas
  • Sort Method: external merge Disk: 11448kB
13. 184.658 1,471.348 ↑ 1.0 330,666 1

Hash Join (cost=22,055.50..41,987.97 rows=339,239 width=60) (actual time=548.761..1,471.348 rows=330,666 loops=1)

  • Hash Cond: (b_mokejimai_1.mok_budas = b_mokejimo_budas.mb_id)
14. 645.036 1,285.542 ↑ 1.0 330,666 1

Hash Join (cost=21,791.34..37,059.27 rows=339,239 width=8) (actual time=547.559..1,285.542 rows=330,666 loops=1)

  • Hash Cond: (b_mokejimu_sudengimai_1.ms_padengimas = b_mokejimai_1.mok_id)
15. 99.163 99.163 ↑ 1.0 330,666 1

Seq Scan on b_mokejimu_sudengimai b_mokejimu_sudengimai_1 (cost=0.00..5,823.39 rows=339,239 width=8) (actual time=0.007..99.163 rows=330,666 loops=1)

16. 252.992 541.343 ↑ 1.0 544,448 1

Hash (cost=12,855.93..12,855.93 rows=544,593 width=8) (actual time=541.343..541.343 rows=544,448 loops=1)

  • Buckets: 131072 Batches: 8 Memory Usage: 3685kB
17. 288.351 288.351 ↑ 1.0 544,448 1

Seq Scan on b_mokejimai b_mokejimai_1 (cost=0.00..12,855.93 rows=544,593 width=8) (actual time=0.065..288.351 rows=544,448 loops=1)

18. 0.030 1.148 ↑ 1.0 33 1

Hash (cost=263.75..263.75 rows=33 width=60) (actual time=1.148..1.148 rows=33 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
19. 0.064 1.118 ↑ 1.0 33 1

Nested Loop Left Join (cost=0.57..263.75 rows=33 width=60) (actual time=0.225..1.118 rows=33 loops=1)

  • Join Filter: (vertimo_reiksmes.vrs_kalba = kalba.klb_id)
  • Rows Removed by Join Filter: 68
20. 0.037 0.724 ↑ 1.0 33 1

Nested Loop (cost=0.29..245.04 rows=33 width=33) (actual time=0.189..0.724 rows=33 loops=1)

21. 0.039 0.039 ↑ 1.0 1 1

Seq Scan on kalba (cost=0.00..1.06 rows=1 width=4) (actual time=0.036..0.039 rows=1 loops=1)

  • Filter: ((klb_prefix)::text = 'lit'::text)
  • Rows Removed by Filter: 4
22. 0.063 0.648 ↑ 1.0 33 1

Nested Loop (cost=0.29..243.64 rows=33 width=29) (actual time=0.125..0.648 rows=33 loops=1)

23. 0.024 0.024 ↑ 1.0 33 1

Seq Scan on b_mokejimo_budas (cost=0.00..1.33 rows=33 width=36) (actual time=0.017..0.024 rows=33 loops=1)

24. 0.561 0.561 ↑ 1.0 1 33

Index Scan using unq_vertimo_turinys_vrt_reiksme on vertimo_turinys (cost=0.29..7.33 rows=1 width=25) (actual time=0.017..0.017 rows=1 loops=33)

  • Index Cond: ((vrt_reiksme)::text = (b_mokejimo_budas.mb_pavadinimo_raktas)::text)
25. 0.330 0.330 ↑ 1.0 3 33

Index Scan using vertimo_reiksmes_vrs_turinys_key on vertimo_reiksmes (cost=0.29..0.53 rows=3 width=43) (actual time=0.007..0.010 rows=3 loops=33)

  • Index Cond: (vrs_turinys = vertimo_turinys.vrt_id)
26. 9.616 324.770 ↓ 3.8 2,386 1

Sort (cost=23,013.90..23,015.46 rows=623 width=169) (actual time=319.137..324.770 rows=2,386 loops=1)

  • Sort Key: b_mokejimai.mok_id
  • Sort Method: quicksort Memory: 590kB
27. 1.858 315.154 ↓ 3.8 2,386 1

Hash Left Join (cost=5,273.91..22,984.98 rows=623 width=169) (actual time=88.350..315.154 rows=2,386 loops=1)

  • Hash Cond: (klasifikatoriaus_pvm_tarifas.kpf_klasifikatorius = b_pvm_klasifikatorius.pvmk_id)
28. 3.017 313.205 ↓ 3.8 2,386 1

Hash Left Join (cost=5,237.81..22,940.32 rows=623 width=135) (actual time=88.223..313.205 rows=2,386 loops=1)

  • Hash Cond: (b_pvm.pvm_tarifas = klasifikatoriaus_pvm_tarifas.kpf_pvm_tarifas)
29. 2.631 310.038 ↓ 3.8 2,386 1

Nested Loop (cost=5,189.56..22,883.50 rows=623 width=131) (actual time=87.961..310.038 rows=2,386 loops=1)

30. 1.817 300.249 ↓ 3.8 2,386 1

Hash Join (cost=5,189.28..22,691.62 rows=623 width=104) (actual time=87.931..300.249 rows=2,386 loops=1)

  • Hash Cond: (b_pardavimai.pard_pvm = b_pvm.pvm_id)
31. 2.028 298.407 ↓ 2.4 2,386 1

Hash Left Join (cost=5,188.17..22,680.47 rows=1,014 width=88) (actual time=87.866..298.407 rows=2,386 loops=1)

  • Hash Cond: (b_pardavimai.pard_id = b_dokumento_pardavimai.dp_pardavimas)
32. 1.956 210.128 ↓ 2.4 2,386 1

Hash Join (cost=5.58..17,492.63 rows=1,014 width=67) (actual time=1.441..210.128 rows=2,386 loops=1)

  • Hash Cond: (b_pardavimai.pard_prekes_id = b_preke.prek_id)
33. 3.609 208.050 ↓ 1.4 2,386 1

Nested Loop (cost=0.85..17,471.56 rows=1,651 width=65) (actual time=1.285..208.050 rows=2,386 loops=1)

34. 2.709 174.145 ↓ 1.6 4,328 1

Nested Loop (cost=0.42..16,005.99 rows=2,714 width=30) (actual time=1.140..174.145 rows=4,328 loops=1)

35. 152.746 152.746 ↓ 1.8 1,869 1

Seq Scan on b_cekis (cost=0.00..7,876.35 rows=1,035 width=18) (actual time=0.154..152.746 rows=1,869 loops=1)

  • Filter: ((cek_statusas = 2) AND ((cek_uzdarytas)::date >= '2020-05-01'::date) AND ((cek_uzdarytas)::date < '2020-05-02'::date))
  • Rows Removed by Filter: 206478
36. 18.690 18.690 ↑ 1.5 2 1,869

Index Scan using fki_mokejimo_cekis on b_mokejimai (cost=0.42..7.82 rows=3 width=20) (actual time=0.008..0.010 rows=2 loops=1,869)

  • Index Cond: (mok_cekis = b_cekis.cek_id)
37. 30.296 30.296 ↑ 1.0 1 4,328

Index Scan using pk_b_pardavimai_id on b_pardavimai (cost=0.42..0.53 rows=1 width=39) (actual time=0.005..0.007 rows=1 loops=4,328)

  • Index Cond: (pard_id = b_mokejimai.mok_pardavimas)
  • Filter: (pard_tipas = 1)
  • Rows Removed by Filter: 0
38. 0.046 0.122 ↑ 1.0 77 1

Hash (cost=3.77..3.77 rows=77 width=10) (actual time=0.122..0.122 rows=77 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
39. 0.076 0.076 ↑ 1.0 77 1

Seq Scan on b_preke (cost=0.00..3.77 rows=77 width=10) (actual time=0.020..0.076 rows=77 loops=1)

40. 4.936 86.251 ↓ 1.0 10,501 1

Hash (cost=5,052.66..5,052.66 rows=10,394 width=25) (actual time=86.251..86.251 rows=10,501 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 744kB
41. 8.254 81.315 ↓ 1.0 10,501 1

Hash Join (cost=3,853.50..5,052.66 rows=10,394 width=25) (actual time=67.976..81.315 rows=10,501 loops=1)

  • Hash Cond: (b_dokumento_pardavimai.dp_dokumentas = b_dokumentas.dok_id)
42. 5.212 5.212 ↓ 1.0 10,548 1

Seq Scan on b_dokumento_pardavimai (cost=0.00..1,056.16 rows=10,416 width=8) (actual time=0.021..5.212 rows=10,548 loops=1)

43. 2.852 67.849 ↓ 1.0 5,764 1

Hash (cost=3,782.80..3,782.80 rows=5,656 width=21) (actual time=67.849..67.849 rows=5,764 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 380kB
44. 64.997 64.997 ↓ 1.0 5,764 1

Seq Scan on b_dokumentas (cost=0.00..3,782.80 rows=5,656 width=21) (actual time=0.020..64.997 rows=5,764 loops=1)

  • Filter: (dok_tipas = 3)
  • Rows Removed by Filter: 8
45. 0.007 0.025 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=24) (actual time=0.025..0.025 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
46. 0.018 0.018 ↑ 1.0 5 1

Seq Scan on b_pvm (cost=0.00..1.05 rows=5 width=24) (actual time=0.016..0.018 rows=5 loops=1)

47. 7.158 7.158 ↑ 1.0 1 2,386

Index Scan using subjektas_pkey on subjektas (cost=0.28..0.30 rows=1 width=31) (actual time=0.003..0.003 rows=1 loops=2,386)

  • Index Cond: (sub_id = b_mokejimai.mok_moketojas)
48. 0.044 0.150 ↑ 850.0 2 1

Hash (cost=27.00..27.00 rows=1,700 width=16) (actual time=0.150..0.150 rows=2 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 17kB
49. 0.106 0.106 ↑ 850.0 2 1

Seq Scan on klasifikatoriaus_pvm_tarifas (cost=0.00..27.00 rows=1,700 width=16) (actual time=0.104..0.106 rows=2 loops=1)

50. 0.018 0.091 ↑ 580.0 2 1

Hash (cost=21.60..21.60 rows=1,160 width=42) (actual time=0.091..0.091 rows=2 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 17kB
51. 0.073 0.073 ↑ 580.0 2 1

Seq Scan on b_pvm_klasifikatorius (cost=0.00..21.60 rows=1,160 width=42) (actual time=0.072..0.073 rows=2 loops=1)

52. 175,077.556 177,623.384 ↓ 1,651.2 330,236 2,386

Materialize (cost=97,864.00..112,269.97 rows=200 width=12) (actual time=0.741..74.444 rows=330,236 loops=2,386)

53. 79.639 2,545.828 ↓ 1,651.2 330,236 1

Subquery Scan on bilieto_renginys (cost=97,864.00..112,268.97 rows=200 width=12) (actual time=1,694.167..2,545.828 rows=330,236 loops=1)

54. 98.749 2,466.189 ↓ 1,651.2 330,236 1

Unique (cost=97,864.00..112,266.97 rows=200 width=12) (actual time=1,694.163..2,466.189 rows=330,236 loops=1)

55. 232.365 2,367.440 ↑ 1.9 330,236 1

Unique (cost=97,864.00..104,265.32 rows=640,132 width=12) (actual time=1,694.161..2,367.440 rows=330,236 loops=1)

56. 1,369.566 2,135.075 ↓ 1.0 660,472 1

Sort (cost=97,864.00..99,464.33 rows=640,132 width=12) (actual time=1,694.158..2,135.075 rows=660,472 loops=1)

  • Sort Key: blt_bilietas.blt_pardavimas, blt_bilietas.blt_renginys, blt_bilietas.blt_renginio_data
  • Sort Method: external merge Disk: 14176kB
57. 95.691 765.509 ↓ 1.0 660,472 1

Append (cost=0.00..25,188.64 rows=640,132 width=12) (actual time=0.207..765.509 rows=660,472 loops=1)

58. 378.164 378.164 ↓ 1.0 330,236 1

Seq Scan on blt_bilietas (cost=0.00..9,393.66 rows=320,066 width=12) (actual time=0.206..378.164 rows=330,236 loops=1)

59. 291.654 291.654 ↓ 1.0 330,236 1

Seq Scan on blt_bilietas blt_bilietas_1 (cost=0.00..9,393.66 rows=320,066 width=12) (actual time=0.347..291.654 rows=330,236 loops=1)

Planning time : 124.948 ms
Execution time : 336,408.484 ms