explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8eQ0 : Optimization for: plan #SWOX

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 2.095 16.505 ↓ 1,066.0 1,066 1

Nested Loop (cost=2.98..3,043.26 rows=1 width=393) (actual time=0.115..16.505 rows=1,066 loops=1)

  • Join Filter: (adv.adv_type = content_type.id)
  • Rows Removed by Join Filter: 10145
  • Planning time: 1.995 ms
  • Execution time: 16.755 ms
2.          

Initplan (forNested Loop)

3. 0.009 0.009 ↑ 1.0 1 1

Seq Scan on status (cost=0.00..1.26 rows=1 width=4) (actual time=0.007..0.009 rows=1 loops=1)

  • Filter: (status = 'approved'::text)
  • Rows Removed by Filter: 20
4. 0.307 12.269 ↓ 1,066.0 1,066 1

Nested Loop (cost=1.72..3,040.57 rows=1 width=285) (actual time=0.111..12.269 rows=1,066 loops=1)

5. 0.275 9.830 ↓ 1,066.0 1,066 1

Nested Loop (cost=1.43..3,032.26 rows=1 width=281) (actual time=0.100..9.830 rows=1,066 loops=1)

6. 0.796 7.423 ↓ 533.0 1,066 1

Nested Loop (cost=1.14..3,031.62 rows=2 width=214) (actual time=0.083..7.423 rows=1,066 loops=1)

7. 1.192 4.461 ↓ 154.7 1,083 1

Nested Loop (cost=0.85..3,029.40 rows=7 width=210) (actual time=0.060..4.461 rows=1,083 loops=1)

8. 1.383 1.383 ↓ 188.6 943 1

Index Scan using index_4d2b695975bc1c95056d428a5fef5931 on adv_order (cost=0.42..2,986.74 rows=5 width=8) (actual time=0.048..1.383 rows=943 loops=1)

  • Index Cond: (status = ANY ('{3,4}'::integer[]))
  • Filter: ((date_end > (now() - '7 days'::interval)) AND (date_start <= (now() + '1 day'::interval)))
  • Rows Removed by Filter: 102
9. 1.886 1.886 ↑ 2.0 1 943

Index Scan using index_20ec9c3e79ac70aa284a4831307766cd on adv_video (cost=0.42..8.51 rows=2 width=206) (actual time=0.002..0.002 rows=1 loops=943)

  • Index Cond: (adv_order_id = adv_order.id)
10. 2.166 2.166 ↑ 1.0 1 1,083

Index Scan using primary_key_f6a32840c8773b45d8c62e774a6e8cd2 on adv adv_1 (cost=0.29..0.32 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=1,083)

  • Index Cond: (id = adv_video.adv_id)
  • Filter: (status = ANY ('{3,4}'::integer[]))
  • Rows Removed by Filter: 0
11. 2.132 2.132 ↑ 1.0 1 1,066

Index Scan using primary_key_f6a32840c8773b45d8c62e774a6e8cd2 on adv (cost=0.29..0.32 rows=1 width=79) (actual time=0.002..0.002 rows=1 loops=1,066)

  • Index Cond: (id = adv_video.adv_id)
  • Filter: (status = $0)
12. 2.132 2.132 ↑ 1.0 1 1,066

Index Scan using primary_key_3ec90c917dce3da7ffc8690a4b292090 on adv_campaign (cost=0.29..8.31 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1,066)

  • Index Cond: (id = adv_order.adv_campaign_id)
13. 2.132 2.132 ↑ 1.7 11 1,066

Seq Scan on content_type (cost=0.00..1.19 rows=19 width=36) (actual time=0.001..0.002 rows=11 loops=1,066)