explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qGDU

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 31,824.389 ↓ 25.0 25 1

Limit (cost=783,649.16..783,649.16 rows=1 width=719) (actual time=31,824.381..31,824.389 rows=25 loops=1)

2. 0.395 31,824.382 ↓ 25.0 25 1

Sort (cost=783,649.16..783,649.16 rows=1 width=719) (actual time=31,824.378..31,824.382 rows=25 loops=1)

  • Sort Key: customwatc0_.title
  • Sort Method: quicksort Memory: 64kB
3. 30.066 31,823.987 ↓ 37.0 37 1

Nested Loop Left Join (cost=20.22..783,649.15 rows=1 width=719) (actual time=6,785.704..31,823.987 rows=37 loops=1)

  • Join Filter: (customwatc0_.query_id = watchquery1_.id)
  • Rows Removed by Join Filter: 149073
4. 69.380 31,767.873 ↓ 37.0 37 1

Hash Right Join (cost=20.22..783,514.25 rows=1 width=613) (actual time=6,784.601..31,767.873 rows=37 loops=1)

  • Hash Cond: (reports2_.cwid = customwatc0_.cwid)
  • Filter: ((reports2_.report_id IS NULL) OR (reports2_.report_id = (SubPlan 2)))
  • Rows Removed by Filter: 3153
5. 28.669 28.669 ↑ 1.0 95,039 1

Seq Scan on watch_report reports2_ (cost=0.00..7,336.99 rows=95,399 width=517) (actual time=0.003..28.669 rows=95,039 loops=1)

6. 0.019 0.232 ↑ 1.0 37 1

Hash (cost=19.76..19.76 rows=37 width=96) (actual time=0.232..0.232 rows=37 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 6kB
7. 0.213 0.213 ↑ 1.0 37 1

Seq Scan on custom_watch customwatc0_ (cost=0.00..19.76 rows=37 width=96) (actual time=0.057..0.213 rows=37 loops=1)

  • Filter: (entity_id = 6)
  • Rows Removed by Filter: 583
8.          

SubPlan (forHash Right Join)

9. 9.564 31,669.592 ↑ 1.0 1 3,188

Result (cost=157.69..157.70 rows=1 width=0) (actual time=9.934..9.934 rows=1 loops=3,188)

10.          

Initplan (forResult)

11. 9.564 31,660.028 ↑ 1.0 1 3,188

Limit (cost=0.29..157.69 rows=1 width=4) (actual time=9.930..9.931 rows=1 loops=3,188)

12. 31,650.464 31,650.464 ↑ 126.0 1 3,188

Index Scan Backward using watch_report_pkey on watch_report customwatc3_ (cost=0.29..19,832.67 rows=126 width=4) (actual time=9.928..9.928 rows=1 loops=3,188)

  • Index Cond: (report_id IS NOT NULL)
  • Filter: (((report_type)::text = 'CUSTOM'::text) AND (cwid = customwatc0_.cwid))
  • Rows Removed by Filter: 11164
13. 26.048 26.048 ↑ 1.0 4,030 37

Seq Scan on query watchquery1_ (cost=0.00..83.29 rows=4,129 width=106) (actual time=0.007..0.704 rows=4,030 loops=37)