explain.depesz.com

A tool for finding a real cause for slow queries.

Result: kfMB : without sorting

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 29.809 428,406.158 ↑ 158.2 13,665 1

Unique (cost=2,760,831.89..3,009,517.21 rows=2,162,481 width=273) (actual time=428,369.216..428,406.158 rows=13,665 loops=1)

2. 295.986 428,376.349 ↑ 158.2 13,665 1

Sort (cost=2,760,831.89..2,766,238.09 rows=2,162,481 width=273) (actual time=428,369.210..428,376.349 rows=13,665 loops=1)

  • Sort Key: a.unioncd, b.unionnm, c.soccd, c.socnm, d.tcd, d.tnm, count(DISTINCT a.gracd), sum(a.gmlknpg_b), sum(a.gmlkpg_b), sum(a.dnpg_b), sum(a.dpg_b), sum(a.necnpg_b), sum(a.necpg_b), sum(a.beloneyr_b), sum(a.belotfnpg_b), sum(a.belotfpg_b), sum(a.totmlk_b), sum(a.gmlknpg_c), sum(a.gmlkpg_c), sum(a.dnpg_c), sum(a.dpg_c), sum(a.necnpg_c), sum(a.necpg_c), sum(a.beloneyr_c), sum(a.belotfnpg_c), sum(a.belotfpg_c), sum(a.totmlk_c), sum(a.catfeed), sum(a.minrmx), sum(a.gmlknpg_crb), sum(a.gmlkpg_crb), sum(a.dnpg_crb), sum(a.dpg_crb), sum(a.necnpg_crb), sum(a.necpg_crb), sum(a.beloneyr_crb), sum(a.belotfnpg_crb), sum(a.belotfpg_crb), sum(a.totmlk_crb), sum(a.socmlk_b), sum(a.primlk_b), sum(a.hsmlk_b), sum(a.socmlk_c), sum(a.primlk_c), sum(a.hsmlk_c)
3. 13,558.839 428,080.363 ↑ 158.2 13,665 1

GroupAggregate (cost=1,252,650.85..1,733,802.87 rows=2,162,481 width=273) (actual time=411,572.658..428,080.363 rows=13,665 loops=1)

4. 399,090.701 414,521.524 ↓ 1.0 2,173,334 1

Sort (cost=1,252,650.85..1,258,057.05 rows=2,162,481 width=273) (actual time=411,571.103..414,521.524 rows=2,173,334 loops=1)

  • Sort Key: a.unioncd, b.unionnm, c.soccd, c.socnm, d.tcd, d.tnm
5. 3,886.258 15,430.823 ↓ 1.0 2,173,334 1

Hash Join (cost=882.75..225,621.83 rows=2,162,481 width=273) (actual time=199.971..15,430.823 rows=2,173,334 loops=1)

  • Hash Cond: (("outer".unioncd)::text = ("inner".unioncd)::text)
6. 6,105.477 11,544.519 ↓ 1.0 2,173,334 1

Hash Join (cost=881.53..193,183.40 rows=2,162,481 width=251) (actual time=199.826..11,544.519 rows=2,173,334 loops=1)

  • Hash Cond: (("outer".socid)::text = ("inner".socid)::text)
7. 5,239.275 5,239.275 ↓ 1.0 2,193,320 1

Seq Scan on sms_hh_mst a (cost=0.00..126,813.02 rows=2,193,202 width=220) (actual time=0.034..5,239.275 rows=2,193,320 loops=1)

8. 17.310 199.767 ↑ 1.0 15,043 1

Hash (cost=843.70..843.70 rows=15,134 width=55) (actual time=199.767..199.767 rows=15,043 loops=1)

9. 22.347 182.457 ↑ 1.0 15,043 1

Hash Join (cost=5.83..843.70 rows=15,134 width=55) (actual time=107.989..182.457 rows=15,043 loops=1)

  • Hash Cond: (("outer".talcd)::text = ("inner".talucaid)::text)
10. 52.147 52.147 ↑ 1.0 15,084 1

Seq Scan on sms_m_soc c (cost=0.00..610.86 rows=15,134 width=47) (actual time=0.004..52.147 rows=15,084 loops=1)

  • Filter: ((vcd)::text <> '-1'::text)
11. 0.253 107.963 ↑ 1.0 226 1

Hash (cost=5.26..5.26 rows=226 width=31) (actual time=107.963..107.963 rows=226 loops=1)

12. 107.710 107.710 ↑ 1.0 226 1

Seq Scan on sms_taluka_mst d (cost=0.00..5.26 rows=226 width=31) (actual time=89.897..107.710 rows=226 loops=1)

13. 0.026 0.046 ↑ 1.0 17 1

Hash (cost=1.17..1.17 rows=17 width=30) (actual time=0.046..0.046 rows=17 loops=1)

14. 0.020 0.020 ↑ 1.0 17 1

Seq Scan on sms_union_mst b (cost=0.00..1.17 rows=17 width=30) (actual time=0.004..0.020 rows=17 loops=1)