explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nnKR : Primera F1

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Sort (cost=10,141,467.66..10,141,480.55 rows=5,155 width=728) (actual rows= loops=)

  • Sort Key: tbl.social_id, tbl.created_at DESC
2. 0.000 0.000 ↓ 0.0

Subquery Scan on tbl (cost=200,452.83..10,141,149.81 rows=5,155 width=728) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=200,452.83..10,141,072.49 rows=5,155 width=28) (actual rows= loops=)

  • Group Key: tbl_fak_accounts.id, ((tbl_fak_like_counts.created_at)::date)
4. 0.000 0.000 ↓ 0.0

Sort (cost=200,452.83..200,465.72 rows=5,155 width=20) (actual rows= loops=)

  • Sort Key: tbl_fak_accounts.id
5. 0.000 0.000 ↓ 0.0

Gather (cost=1,590.70..200,134.98 rows=5,155 width=20) (actual rows= loops=)

  • Workers Planned: 5
6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=590.70..198,609.17 rows=1,031 width=20) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Hash Join (cost=590.13..155,116.53 rows=1,557 width=8) (actual rows= loops=)

  • Hash Cond: (tbl_fak_accounts.art_id = tbl_w_art.art_id)
8. 0.000 0.000 ↓ 0.0

Parallel Seq Scan on tbl_fak_accounts (cost=0.00..154,208.29 rows=60,506 width=12) (actual rows= loops=)

  • Filter: (ct_id IS NOT NULL)
9. 0.000 0.000 ↓ 0.0

Hash (cost=386.17..386.17 rows=16,317 width=4) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Seq Scan on tbl_w_art (cost=0.00..386.17 rows=16,317 width=4) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Index Only Scan using index_tbl_fak_like_counts_on_tbl_fak_account_id_and_created_at on tbl_fak_like_counts (cost=0.57..27.92 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (tbl_fak_account_id = tbl_fak_accounts.id)
  • Filter: (((created_at)::date < ('now'::cstring)::date) AND ((created_at)::date = (('now'::cstring)::date - 1)))
12.          

SubPlan (forGroupAggregate)

13. 0.000 0.000 ↓ 0.0

Limit (cost=0.57..964.47 rows=1 width=12) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Index Scan Backward using index_tbl_fak_like_counts_on_tbl_fak_account_id_and_created_at on tbl_fak_like_counts tbl_fak_like_counts_1 (cost=0.57..1,928.37 rows=2 width=12) (actual rows= loops=)

  • Index Cond: (tbl_fak_account_id = tbl_fak_accounts.id)
  • Filter: ((created_at)::date = (min(((tbl_fak_like_counts.created_at)::date)) - 1))
15. 0.000 0.000 ↓ 0.0

Limit (cost=0.57..963.84 rows=1 width=12) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Index Scan Backward using index_tbl_fak_like_counts_on_tbl_fak_account_id_and_created_at on tbl_fak_like_counts tbl_fak_like_counts_2 (cost=0.57..1,927.12 rows=2 width=12) (actual rows= loops=)

  • Index Cond: (tbl_fak_account_id = tbl_fak_accounts.id)
  • Filter: ((created_at)::date = min(((tbl_fak_like_counts.created_at)::date)))