explain.depesz.com

PostgreSQL's explain analyze made readable

Result: KUBP

Settings
# exclusive inclusive rows x rows loops node
1. 3.571 1,735.240 ↓ 848.0 848 1

Sort (cost=30,079.07..30,079.08 rows=1 width=792) (actual time=1,735.185..1,735.240 rows=848 loops=1)

  • Sort Key: tb_news.dt_news DESC, ((tb_news.hr_news)::character varying) DESC
  • Sort Method: quicksort Memory: 552kB
2. 4.359 1,731.669 ↓ 848.0 848 1

GroupAggregate (cost=30,079.07..30,079.07 rows=1 width=792) (actual time=1,727.054..1,731.669 rows=848 loops=1)

  • Group Key: tb_news.id_news, tb_news_agency.id_news_agency, tb_news_agency_classification.ds_news_agency_classification, (CASE WHEN tb_news.is_pdf THEN tb_news.ds_body ELSE NULL::character varying END)
3. 2.976 1,727.310 ↓ 1,557.0 1,557 1

Sort (cost=30,079.07..30,079.07 rows=1 width=661) (actual time=1,727.012..1,727.310 rows=1,557 loops=1)

  • Sort Key: tb_news.id_news, tb_news_agency.id_news_agency, tb_news_agency_classification.ds_news_agency_classification, (CASE WHEN tb_news.is_pdf THEN tb_news.ds_body ELSE NULL::character varying END)
  • Sort Method: quicksort Memory: 692kB
4. 3.386 1,724.334 ↓ 1,557.0 1,557 1

Nested Loop Left Join (cost=0.13..30,079.06 rows=1 width=661) (actual time=280.808..1,724.334 rows=1,557 loops=1)

  • Join Filter: ((tb_pivot_news.id_contract = tb_pivot_news_agency.id_contract) AND (tb_pivot_news.id_agency = tb_pivot_news_agency.id_agency))
  • Rows Removed by Join Filter: 7,232
5. 2.178 1,717.834 ↓ 1,557.0 1,557 1

Nested Loop Left Join (cost=0.13..30,078.05 rows=1 width=737) (actual time=280.790..1,717.834 rows=1,557 loops=1)

6. 169.869 1,712.542 ↓ 1,557.0 1,557 1

Nested Loop Left Join (cost=0.08..30,076.43 rows=1 width=648) (actual time=280.781..1,712.542 rows=1,557 loops=1)

  • Join Filter: (tb_news_origin.id_news = tb_news.id_news)
  • Rows Removed by Join Filter: 2,959,661
7. 4.407 343.105 ↓ 1,492.0 1,492 1

Nested Loop Left Join (cost=0.08..29,993.31 rows=1 width=640) (actual time=279.514..343.105 rows=1,492 loops=1)

  • Join Filter: (tb_agency_tag.id_agency_tag = tb_agency_tag_news.id_agency_tag)
  • Rows Removed by Join Filter: 24,660
8. 0.942 335.714 ↓ 1,492.0 1,492 1

Nested Loop Left Join (cost=0.08..29,992.24 rows=1 width=629) (actual time=279.502..335.714 rows=1,492 loops=1)

9. 2.939 328.836 ↓ 848.0 848 1

Nested Loop Left Join (cost=0.06..29,990.21 rows=1 width=625) (actual time=279.483..328.836 rows=848 loops=1)

  • Join Filter: ((tb_news.id_news_agency = tb_news_agency_classification.id_news_agency) AND (tb_news.id_news_agency_classification = tb_news_agency_classification.id_news_agency_classification))
  • Rows Removed by Join Filter: 11,024
10. 0.499 324.201 ↓ 848.0 848 1

Nested Loop (cost=0.06..29,989.18 rows=1 width=620) (actual time=279.464..324.201 rows=848 loops=1)

11. 0.048 0.048 ↑ 1.0 41 1

Seq Scan on tb_news_agency (cost=0.00..1.04 rows=41 width=29) (actual time=0.007..0.048 rows=41 loops=1)

12. 323.654 323.654 ↓ 21.0 21 41

Index Scan using tb_news_id_news_agency_is_pdf_ds_headline_id_news_dt_news_idx on tb_news (cost=0.06..731.42 rows=1 width=591) (actual time=6.934..7.894 rows=21 loops=41)

  • Index Cond: ((id_news_agency = tb_news_agency.id_news_agency) AND (dt_news >= 20,200,729) AND (dt_news <= 20,200,729))
13. 1.696 1.696 ↑ 1.0 13 848

Seq Scan on tb_news_agency_classification (cost=0.00..1.01 rows=13 width=21) (actual time=0.002..0.002 rows=13 loops=848)

14. 5.936 5.936 ↑ 2.0 1 848

Index Only Scan using tb_agency_tag_news_pk on tb_agency_tag_news (cost=0.03..2.03 rows=2 width=8) (actual time=0.006..0.007 rows=1 loops=848)

  • Index Cond: (id_news = tb_news.id_news)
  • Heap Fetches: 1,083
15. 2.984 2.984 ↑ 1.7 17 1,492

Seq Scan on tb_agency_tag (cost=0.00..1.03 rows=29 width=15) (actual time=0.001..0.002 rows=17 loops=1,492)

16. 1,199.568 1,199.568 ↑ 1.0 1,984 1,492

Seq Scan on tb_news_origin (cost=0.00..80.64 rows=1,984 width=16) (actual time=0.004..0.804 rows=1,984 loops=1,492)

  • Filter: (is_validated IS TRUE)
  • Rows Removed by Filter: 7,581
17. 3.114 3.114 ↓ 0.0 0 1,557

Index Scan using tb_pivot_news_pk on tb_pivot_news (cost=0.04..1.63 rows=1 width=97) (actual time=0.002..0.002 rows=0 loops=1,557)

  • Index Cond: (id_news = tb_news_origin.id_news_origin)
18. 3.114 3.114 ↑ 1.0 5 1,557

Seq Scan on tb_pivot_news_agency (cost=0.00..1.00 rows=5 width=26) (actual time=0.001..0.002 rows=5 loops=1,557)

Planning time : 2.051 ms
Execution time : 1,735.630 ms