explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MaaK

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 1,288.849 ↓ 25.0 25 1

Limit (cost=271,705.40..271,705.41 rows=1 width=753) (actual time=1,288.841..1,288.849 rows=25 loops=1)

2. 1.348 1,288.848 ↓ 25.0 25 1

Sort (cost=271,705.40..271,705.41 rows=1 width=753) (actual time=1,288.841..1,288.848 rows=25 loops=1)

  • Sort Key: customwatc0_.title
  • Sort Method: top-N heapsort Memory: 49kB
3. 256.288 1,287.500 ↓ 529.0 529 1

Nested Loop Left Join (cost=100.43..271,705.39 rows=1 width=753) (actual time=1.107..1,287.500 rows=529 loops=1)

  • Join Filter: (customwatc0_.query_id = watchquery1_.id)
  • Rows Removed by Join Filter: 2131870
4. 50.554 804.271 ↓ 529.0 529 1

Hash Right Join (cost=100.43..271,574.70 rows=1 width=616) (actual time=0.643..804.271 rows=529 loops=1)

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

Seq Scan on watch_report reports2_ (cost=0.00..6,945.99 rows=95,399 width=520) (actual time=0.004..37.340 rows=95,399 loops=1)

6. 0.069 0.454 ↑ 1.1 529 1

Hash (cost=93.28..93.28 rows=572 width=96) (actual time=0.454..0.454 rows=529 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 81kB
7. 0.385 0.385 ↑ 1.1 529 1

Seq Scan on custom_watch customwatc0_ (cost=0.00..93.28 rows=572 width=96) (actual time=0.012..0.385 rows=529 loops=1)

  • Filter: (entity_id = ANY ('{6,14504,11443,14184,13636,1402,13290,3320,14480,11595,1857,3520,14632,14191,4193,12893,14513,13750,13782,974,4812,13012,14168,856,12678,13006,8797,1322,14009,5776,14766,11172,13279,13626,13625,4013,5959,12548,5878,1441,13863,12169,13627,14607,9877,13052,2612,5852,5953,3617,11164,3906,5927,11171,13637,13641,11381,14395,6312,13301,5559,12209,11597,13640,9347,11296,11197,13781,12045,10942,12596,2500,1750,4037,13164,1657,14059,12995,14544,6,5471,10355,4194,1646,8459,14094,7599,4784,10983,3975,4060,13856,13540,14341,12529,3321,4923,7571}'::integer[]))
  • Rows Removed by Filter: 92
8.          

SubPlan (forHash Right Join)

9. 79.547 715.923 ↑ 1.0 1 79,547

Result (cost=3.43..3.44 rows=1 width=4) (actual time=0.009..0.009 rows=1 loops=79,547)

10.          

Initplan (forResult)

11. 0.000 636.376 ↑ 1.0 1 79,547

Limit (cost=0.42..3.43 rows=1 width=4) (actual time=0.008..0.008 rows=1 loops=79,547)

12. 636.376 636.376 ↑ 140.0 1 79,547

Index Only Scan Backward using idx_report_id_cwid_2 on watch_report customwatc3_ (cost=0.42..421.82 rows=140 width=4) (actual time=0.008..0.008 rows=1 loops=79,547)

  • Index Cond: ((cwid = customwatc0_.cwid) AND (report_id IS NOT NULL))
  • Heap Fetches: 79547
13. 226.941 226.941 ↑ 1.0 4,031 529

Seq Scan on query watchquery1_ (cost=0.00..80.31 rows=4,031 width=105) (actual time=0.003..0.429 rows=4,031 loops=529)