explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ELz8

Settings
# exclusive inclusive rows x rows loops node
1. 0.632 26.271 ↓ 183.0 183 1

Sort (cost=3,900.67..3,900.67 rows=1 width=792) (actual time=26.245..26.271 rows=183 loops=1)

  • Sort Key: tb_news.dt_news DESC, ((tb_news.hr_news)::character varying) DESC
  • Sort Method: quicksort Memory: 203kB
2. 1.309 25.639 ↓ 183.0 183 1

GroupAggregate (cost=3,900.66..3,900.67 rows=1 width=792) (actual time=24.337..25.639 rows=183 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. 0.573 24.330 ↓ 487.0 487 1

Sort (cost=3,900.66..3,900.66 rows=1 width=661) (actual time=24.298..24.330 rows=487 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: 278kB
4. 1.007 23.757 ↓ 487.0 487 1

Nested Loop Left Join (cost=0.11..3,900.66 rows=1 width=661) (actual time=12.890..23.757 rows=487 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: 1,862
5. 0.447 22.263 ↓ 487.0 487 1

Nested Loop Left Join (cost=0.11..3,899.65 rows=1 width=737) (actual time=12.877..22.263 rows=487 loops=1)

6. 1.134 19.868 ↓ 487.0 487 1

Nested Loop Left Join (cost=0.07..3,898.02 rows=1 width=648) (actual time=12.859..19.868 rows=487 loops=1)

  • Join Filter: (tb_agency_tag.id_agency_tag = tb_agency_tag_news.id_agency_tag)
  • Rows Removed by Join Filter: 6,355
7. 0.153 17.760 ↓ 487.0 487 1

Nested Loop Left Join (cost=0.07..3,896.95 rows=1 width=637) (actual time=12.850..17.760 rows=487 loops=1)

8. 0.468 16.731 ↓ 219.0 219 1

Nested Loop Left Join (cost=0.04..3,894.92 rows=1 width=633) (actual time=12.828..16.731 rows=219 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: 2,847
9. 0.584 15.825 ↓ 219.0 219 1

Nested Loop (cost=0.04..3,893.89 rows=1 width=628) (actual time=12.815..15.825 rows=219 loops=1)

  • Join Filter: (tb_news.id_news_agency = tb_news_agency.id_news_agency)
  • Rows Removed by Join Filter: 5,222
10. 0.879 14.146 ↓ 219.0 219 1

Nested Loop (cost=0.04..3,892.79 rows=1 width=599) (actual time=12.793..14.146 rows=219 loops=1)

11. 1.285 1.285 ↓ 1.0 1,997 1

Seq Scan on tb_news_origin (cost=0.00..80.64 rows=1,984 width=16) (actual time=0.008..1.285 rows=1,997 loops=1)

  • Filter: (is_validated IS TRUE)
  • Rows Removed by Filter: 7,602
12. 11.982 11.982 ↓ 0.0 0 1,997

Index Scan using tb_news_im2_pk on tb_news (cost=0.04..1.92 rows=1 width=591) (actual time=0.006..0.006 rows=0 loops=1,997)

  • Index Cond: (id_news = tb_news_origin.id_news)
  • Filter: ((dt_news >= 20,200,729) AND (dt_news <= 20,200,729))
  • Rows Removed by Filter: 1
13. 1.095 1.095 ↑ 1.6 25 219

Seq Scan on tb_news_agency (cost=0.00..1.04 rows=41 width=29) (actual time=0.001..0.005 rows=25 loops=219)

14. 0.438 0.438 ↑ 1.0 13 219

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

15. 0.876 0.876 ↑ 1.0 2 219

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.003..0.004 rows=2 loops=219)

  • Index Cond: (id_news = tb_news.id_news)
  • Heap Fetches: 442
16. 0.974 0.974 ↑ 2.1 14 487

Seq Scan on tb_agency_tag (cost=0.00..1.03 rows=29 width=15) (actual time=0.001..0.002 rows=14 loops=487)

17. 1.948 1.948 ↑ 1.0 1 487

Index Scan using tb_pivot_news_pk on tb_pivot_news (cost=0.04..1.63 rows=1 width=97) (actual time=0.004..0.004 rows=1 loops=487)

  • Index Cond: (id_news = tb_news_origin.id_news_origin)
18. 0.487 0.487 ↑ 1.0 5 487

Seq Scan on tb_pivot_news_agency (cost=0.00..1.00 rows=5 width=26) (actual time=0.001..0.001 rows=5 loops=487)

Planning time : 1.817 ms
Execution time : 26.452 ms