explain.depesz.com

PostgreSQL's explain analyze made readable

Result: m869

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 1,243.761 ↑ 1.1 8 1

Limit (cost=128,606.57..128,712.11 rows=9 width=220) (actual time=1,243.551..1,243.761 rows=8 loops=1)

2. 0.129 1,243.760 ↑ 1.1 8 1

GroupAggregate (cost=128,606.57..128,712.11 rows=9 width=220) (actual time=1,243.550..1,243.760 rows=8 loops=1)

  • Group Key: t0.id, ctg_f.id, ctg_v.id
3. 0.079 1,243.399 ↓ 12.8 115 1

Sort (cost=128,606.57..128,606.59 rows=9 width=148) (actual time=1,243.394..1,243.399 rows=115 loops=1)

  • Sort Key: t0.id DESC, ctg_f.id, ctg_v.id
  • Sort Method: quicksort Memory: 55kB
4. 788.671 1,243.320 ↓ 12.8 115 1

Nested Loop (cost=0.00..128,606.43 rows=9 width=148) (actual time=12.177..1,243.320 rows=115 loops=1)

  • Join Filter: (t0.id = zk.group_id)
  • Rows Removed by Join Filter: 7674109
5. 39.887 454.649 ↓ 130.1 959,278 1

Append (cost=0.00..127,836.70 rows=7,372 width=28) (actual time=0.026..454.649 rows=959,278 loops=1)

6. 0.004 0.004 ↓ 0.0 0 1

Seq Scan on zaiko zk (cost=0.00..0.00 rows=1 width=56) (actual time=0.004..0.004 rows=0 loops=1)

  • Filter: (id = orgid)
7. 414.758 414.758 ↓ 130.1 959,278 1

Seq Scan on zaiko zk_1 (cost=0.00..127,836.70 rows=7,371 width=28) (actual time=0.022..414.758 rows=959,278 loops=1)

  • Filter: (id = orgid)
  • Rows Removed by Filter: 467391
8. 0.000 0.000 ↓ 1.3 8 959,278

Materialize (cost=0.00..106.26 rows=6 width=124) (actual time=0.000..0.000 rows=8 loops=959,278)

9. 0.002 0.094 ↓ 1.3 8 1

Nested Loop Left Join (cost=0.00..106.23 rows=6 width=124) (actual time=0.026..0.094 rows=8 loops=1)

10. 0.003 0.052 ↓ 1.3 8 1

Nested Loop Left Join (cost=0.00..101.07 rows=6 width=98) (actual time=0.015..0.052 rows=8 loops=1)

11. 0.000 0.009 ↓ 1.3 8 1

Append (cost=0.00..1.26 rows=6 width=68) (actual time=0.005..0.009 rows=8 loops=1)

12. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on simple_proposal t0 (cost=0.00..0.00 rows=1 width=54) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: ((active = 1) AND ((is_fake = 0) OR ((is_fake = 1) AND (created_by = 1))))
13. 0.008 0.008 ↓ 1.6 8 1

Seq Scan on simple_proposal t0_1 (cost=0.00..1.26 rows=5 width=71) (actual time=0.004..0.008 rows=8 loops=1)

  • Filter: ((active = 1) AND ((is_fake = 0) OR ((is_fake = 1) AND (created_by = 1))))
  • Rows Removed by Filter: 9
14. 0.008 0.040 ↑ 3.0 1 8

Append (cost=0.00..16.60 rows=3 width=34) (actual time=0.003..0.005 rows=1 loops=8)

15. 0.000 0.000 ↓ 0.0 0 8

Seq Scan on catalog ctg_v (cost=0.00..0.00 rows=1 width=42) (actual time=0.000..0.000 rows=0 loops=8)

  • Filter: (id = t0.catalog_id)
16. 0.024 0.024 ↑ 1.0 1 8

Index Scan using catalog_pkey on catalog ctg_v_1 (cost=0.29..8.31 rows=1 width=34) (actual time=0.003..0.003 rows=1 loops=8)

  • Index Cond: (id = t0.catalog_id)
17. 0.008 0.008 ↓ 0.0 0 8

Index Scan using catalog_brand_pkey on catalog_brand ctg_v_2 (cost=0.28..8.30 rows=1 width=42) (actual time=0.001..0.001 rows=0 loops=8)

  • Index Cond: (id = t0.catalog_id)
18. 0.008 0.040 ↑ 3.0 1 8

Append (cost=0.00..0.83 rows=3 width=30) (actual time=0.003..0.005 rows=1 loops=8)

19. 0.000 0.000 ↓ 0.0 0 8

Seq Scan on catalog ctg_f (cost=0.00..0.00 rows=1 width=38) (actual time=0.000..0.000 rows=0 loops=8)

  • Filter: (id = ctg_v.brand)
20. 0.024 0.024 ↑ 1.0 1 8

Index Scan using catalog_pkey on catalog ctg_f_1 (cost=0.29..0.50 rows=1 width=30) (actual time=0.003..0.003 rows=1 loops=8)

  • Index Cond: (id = ctg_v.brand)
21. 0.008 0.008 ↓ 0.0 0 8

Index Scan using catalog_brand_pkey on catalog_brand ctg_f_2 (cost=0.28..0.33 rows=1 width=38) (actual time=0.001..0.001 rows=0 loops=8)

  • Index Cond: (id = ctg_v.brand)
22.          

SubPlan (for GroupAggregate)

23. 0.040 0.232 ↑ 1.0 1 8

Aggregate (cost=11.57..11.58 rows=1 width=32) (actual time=0.029..0.029 rows=1 loops=8)

24. 0.016 0.192 ↑ 1.5 2 8

Subquery Scan on ctgf (cost=11.51..11.55 rows=3 width=103) (actual time=0.023..0.024 rows=2 loops=8)

25. 0.016 0.176 ↑ 1.5 2 8

Sort (cost=11.51..11.52 rows=3 width=111) (actual time=0.022..0.022 rows=2 loops=8)

  • Sort Key: ctg_file.id DESC
  • Sort Method: quicksort Memory: 25kB
26. 0.120 0.160 ↑ 1.5 2 8

Result (cost=0.00..11.49 rows=3 width=111) (actual time=0.017..0.020 rows=2 loops=8)

27. 0.000 0.040 ↑ 1.5 2 8

Append (cost=0.00..10.71 rows=3 width=87) (actual time=0.004..0.005 rows=2 loops=8)

28. 0.008 0.008 ↓ 0.0 0 8

Result (cost=0.00..0.00 rows=1 width=52) (actual time=0.001..0.001 rows=0 loops=8)

  • One-Time Filter: (ctg_v.active = 1)
29. 0.000 0.000 ↓ 0.0 0 8

Seq Scan on catalog_file ctg_file (cost=0.00..0.00 rows=1 width=52) (actual time=0.000..0.000 rows=0 loops=8)

  • Filter: (catalog_id = ctg_v.id)
30. 0.008 0.032 ↑ 1.0 2 8

Result (cost=0.29..10.71 rows=2 width=104) (actual time=0.003..0.004 rows=2 loops=8)

  • One-Time Filter: (ctg_v.active = 1)
31. 0.024 0.024 ↑ 1.0 2 8

Index Scan using catalog_file_catalog_id_idx on catalog_file ctg_file_1 (cost=0.29..10.71 rows=2 width=104) (actual time=0.003..0.003 rows=2 loops=8)

  • Index Cond: (catalog_id = ctg_v.id)
Planning time : 0.888 ms
Execution time : 1,243.945 ms