explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YbEn

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 4,029.314 ↑ 1.0 10 1

Limit (cost=86,985.36..86,985.39 rows=10 width=335) (actual time=4,029.308..4,029.314 rows=10 loops=1)

2.          

CTE reference

3. 0.042 0.163 ↓ 2.4 17 1

Hash Join (cost=23.97..50.78 rows=7 width=65) (actual time=0.155..0.163 rows=17 loops=1)

  • Hash Cond: (g2l.source_id = ic.id)
4. 0.051 0.051 ↑ 4.9 271 1

Seq Scan on g2l (cost=0.00..23.30 rows=1,330 width=33) (actual time=0.029..0.051 rows=271 loops=1)

5. 0.016 0.070 ↓ 2.5 57 1

Hash (cost=23.68..23.68 rows=23 width=80) (actual time=0.070..0.070 rows=57 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 24kB
6. 0.054 0.054 ↓ 2.5 57 1

Index Scan using category_hierarchy_idx on category ic (cost=0.28..23.68 rows=23 width=80) (actual time=0.029..0.054 rows=57 loops=1)

  • Index Cond: (hierarchy = 'compte_tva_pro'::text)
7. 20.983 4,029.307 ↑ 2.9 30 1

Sort (cost=86,934.53..86,934.75 rows=88 width=335) (actual time=4,029.305..4,029.307 rows=30 loops=1)

  • Sort Key: c.name
  • Sort Method: quicksort Memory: 67515kB
8. 1,453.000 4,008.324 ↑ 1.7 52 1

GroupAggregate (cost=85,805.08..86,931.93 rows=88 width=335) (actual time=2,776.466..4,008.324 rows=52 loops=1)

  • Group Key: c.id
9. 288.114 2,555.324 ↓ 26.2 1,309,931 1

Merge Left Join (cost=85,805.08..86,056.04 rows=49,963 width=296) (actual time=2,003.239..2,555.324 rows=1,309,931 loops=1)

  • Merge Cond: (c.id = ref.target_id)
10. 1,443.899 2,229.857 ↓ 26.2 1,309,931 1

Sort (cost=85,804.84..85,929.75 rows=49,963 width=247) (actual time=2,003.033..2,229.857 rows=1,309,931 loops=1)

  • Sort Key: c.id
  • Sort Method: external merge Disk: 403304kB
11. 564.206 785.958 ↓ 26.2 1,309,931 1

Hash Right Join (cost=20.30..81,905.59 rows=49,963 width=247) (actual time=0.164..785.958 rows=1,309,931 loops=1)

  • Hash Cond: (cla.label_id = c.id)
12. 221.618 221.618 ↑ 1.0 2,602,140 1

Seq Scan on classification cla (cost=0.00..75,045.66 rows=2,603,166 width=32) (actual time=0.007..221.618 rows=2,602,140 loops=1)

13. 0.049 0.134 ↑ 1.7 52 1

Hash (cost=19.20..19.20 rows=88 width=231) (actual time=0.133..0.134 rows=52 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 26kB
14. 0.085 0.085 ↑ 1.7 52 1

Index Scan using category_hierarchy_idx on category c (cost=0.28..19.20 rows=88 width=231) (actual time=0.032..0.085 rows=52 loops=1)

  • Index Cond: (hierarchy = 'compte_tva_pro'::text)
15. 37.178 37.353 ↓ 129,018.1 903,127 1

Sort (cost=0.24..0.26 rows=7 width=65) (actual time=0.200..37.353 rows=903,127 loops=1)

  • Sort Key: ref.target_id
  • Sort Method: quicksort Memory: 27kB
16. 0.175 0.175 ↓ 2.4 17 1

CTE Scan on reference ref (cost=0.00..0.14 rows=7 width=65) (actual time=0.159..0.175 rows=17 loops=1)

Planning time : 0.904 ms
Execution time : 4,119.057 ms