explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7niP

Settings
# exclusive inclusive rows x rows loops node
1. 3.050 62.475 ↓ 65.0 65 1

GroupAggregate (cost=2,201.75..2,201.75 rows=1 width=247) (actual time=59.316..62.475 rows=65 loops=1)

  • Group Key: tb_pivot_news.id_news, tb_pivot_news_agency.id_agency, tb_pivot_news_agency.ds_agency, tb_pivot_news_agency.ds_agency_nickname, tb_pivot_news_agency.hr_relevancy
2. 3.008 59.425 ↓ 3,578.0 3,578 1

Sort (cost=2,201.75..2,201.75 rows=1 width=161) (actual time=59.271..59.425 rows=3,578 loops=1)

  • Sort Key: tb_pivot_news.id_news, tb_pivot_news_agency.id_agency, tb_pivot_news_agency.ds_agency, tb_pivot_news_agency.ds_agency_nickname, tb_pivot_news_agency.hr_relevancy
  • Sort Method: quicksort Memory: 1,047kB
3. 0.000 56.417 ↓ 3,578.0 3,578 1

Nested Loop Left Join (cost=160.45..2,201.75 rows=1 width=161) (actual time=46.214..56.417 rows=3,578 loops=1)

4. 0.231 53.276 ↓ 3,578.0 3,578 1

Nested Loop Left Join (cost=160.44..2,201.73 rows=1 width=150) (actual time=46.204..53.276 rows=3,578 loops=1)

5. 0.170 51.383 ↓ 831.0 831 1

Nested Loop Left Join (cost=160.41..2,200.74 rows=1 width=146) (actual time=46.197..51.383 rows=831 loops=1)

6. 0.194 49.577 ↓ 818.0 818 1

Nested Loop (cost=160.38..2,200.71 rows=1 width=124) (actual time=46.183..49.577 rows=818 loops=1)

7. 0.588 48.565 ↓ 818.0 818 1

Hash Join (cost=160.37..2,200.61 rows=1 width=102) (actual time=46.167..48.565 rows=818 loops=1)

  • Hash Cond: (tb_pivot_news.id_news = tb_agency_tag_pivot_news_1.id_news)
8. 27.977 46.460 ↓ 267.9 6,161 1

Hash Right Join (cost=21.51..2,061.74 rows=23 width=102) (actual time=44.620..46.460 rows=6,161 loops=1)

  • Hash Cond: (tb_pivot_news_tag.id_news = tb_pivot_news.id_news)
9. 17.563 17.563 ↓ 1.0 277,865 1

Seq Scan on tb_pivot_news_tag (cost=0.00..1,967.41 rows=277,410 width=9) (actual time=0.007..17.563 rows=277,865 loops=1)

10. 0.128 0.920 ↓ 20.6 474 1

Hash (cost=21.48..21.48 rows=23 width=97) (actual time=0.919..0.920 rows=474 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 70kB
11. 0.792 0.792 ↓ 20.6 474 1

Index Scan using tb_pivot_news_id_contract_dh_news_idx on tb_pivot_news (cost=0.04..21.48 rows=23 width=97) (actual time=0.026..0.792 rows=474 loops=1)

  • Index Cond: ((id_contract = 2,020) AND (dh_news >= '2020-09-08 00:00:00'::timestamp without time zone) AND (dh_news <= '2020-09-09 23:00:00'::timestamp without time zone))
12. 0.235 1.517 ↓ 1.1 2,874 1

Hash (cost=135.48..135.48 rows=2,705 width=4) (actual time=1.517..1.517 rows=2,874 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 134kB
13. 0.321 1.282 ↓ 1.1 2,874 1

Unique (cost=0.03..132.78 rows=2,705 width=4) (actual time=0.096..1.282 rows=2,874 loops=1)

14. 0.961 0.961 ↓ 1.0 2,874 1

Index Only Scan using tb_agency_tag_pivot_news_pk on tb_agency_tag_pivot_news tb_agency_tag_pivot_news_1 (cost=0.03..132.06 rows=2,856 width=4) (actual time=0.095..0.961 rows=2,874 loops=1)

  • Index Cond: (id_agency_tag = 20)
  • Heap Fetches: 29
15. 0.818 0.818 ↑ 1.0 1 818

Index Scan using tb_pivot_news_agency_pk on tb_pivot_news_agency (cost=0.01..0.15 rows=1 width=34) (actual time=0.001..0.001 rows=1 loops=818)

  • Index Cond: ((id_contract = 2,020) AND (id_agency = tb_pivot_news.id_agency))
16. 1.636 1.636 ↓ 0.0 0 818

Index Only Scan using tb_reuters_news_topics_catalog_cd_topic_ds_topic_pt_full_idx on tb_reuters_news_topics_catalog (cost=0.03..0.03 rows=1 width=26) (actual time=0.002..0.002 rows=0 loops=818)

  • Index Cond: (cd_topic = (tb_pivot_news_tag.tag)::text)
  • Heap Fetches: 0
17. 1.662 1.662 ↓ 2.0 4 831

Index Only Scan using tb_agency_tag_pivot_news_pk on tb_agency_tag_pivot_news (cost=0.03..0.99 rows=2 width=8) (actual time=0.001..0.002 rows=4 loops=831)

  • Index Cond: (id_news = tb_pivot_news.id_news)
  • Heap Fetches: 1,522
18. 3.578 3.578 ↑ 1.0 1 3,578

Index Scan using tb_agency_tag_pk on tb_agency_tag (cost=0.01..0.02 rows=1 width=15) (actual time=0.001..0.001 rows=1 loops=3,578)

  • Index Cond: (id_agency_tag = tb_agency_tag_pivot_news.id_agency_tag)
Planning time : 1.752 ms
Execution time : 62.720 ms