explain.depesz.com

PostgreSQL's explain analyze made readable

Result: SWOX

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 1.555 19.520 ↓ 1,066.0 1,066 1

Sort (cost=3,043.27..3,043.27 rows=1 width=393) (actual time=19.342..19.520 rows=1,066 loops=1)

  • Sort Key: adv_video.id
  • Sort Method: quicksort Memory: 593kB
2.          

Initplan (forSort)

3. 0.010 0.010 ↑ 1.0 1 1

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

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

Nested Loop (cost=1.72..3,042.00 rows=1 width=393) (actual time=0.071..17.955 rows=1,066 loops=1)

  • Join Filter: (adv.adv_type = content_type.id)
  • Rows Removed by Join Filter: 10145
5. 0.608 13.374 ↓ 1,066.0 1,066 1

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

6. 0.457 10.634 ↓ 1,066.0 1,066 1

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

7. 0.889 8.045 ↓ 533.0 1,066 1

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

8. 0.669 4.990 ↓ 154.7 1,083 1

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

9. 1.492 1.492 ↓ 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.025..1.492 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
10. 2.829 2.829 ↑ 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.003 rows=1 loops=943)

  • Index Cond: (adv_order_id = adv_order.id)
11. 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
12. 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)
13. 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)
14. 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)