explain.depesz.com

PostgreSQL's explain analyze made readable

Result: EFoe : gb

Settings
# exclusive inclusive rows x rows loops node
1. 1.350 11,870.671 ↑ 1.0 100 1

Limit (cost=116,397.35..116,397.60 rows=100 width=127) (actual time=11,868.709..11,870.671 rows=100 loops=1)

2. 2,487.999 11,869.321 ↑ 5,105.4 100 1

Sort (cost=116,397.35..117,673.71 rows=510,543 width=127) (actual time=11,868.694..11,869.321 rows=100 loops=1)

  • Sort Key: inspections_purchaseorder.updated_at DESC
  • Sort Method: top-N heapsort Memory: 41kB
3. 4,683.382 9,381.322 ↑ 1.5 333,513 1

Group (cost=14,496.42..96,884.76 rows=510,543 width=127) (actual time=1,175.412..9,381.322 rows=333,513 loops=1)

  • Group Key: inspections_purchaseorder.id
4. 4,117.692 4,697.940 ↑ 1.5 333,513 1

Index Scan using inspections_purchaseorder_pkey on inspections_purchaseorder (cost=14,496.42..95,608.41 rows=510,543 width=127) (actual time=1,175.285..4,697.940 rows=333,513 loops=1)

  • Filter: ((org_id = 252,437) OR ((org_id <> 252437) AND (hashed SubPlan 1)))
  • Rows Removed by Filter: 576,650
5.          

SubPlan (for Index Scan)

6. 572.484 580.248 ↑ 1.0 76,072 1

Bitmap Heap Scan on inspections_purchaseordershare u0 (cost=1,459.59..14,301.42 rows=77,827 width=4) (actual time=8.966..580.248 rows=76,072 loops=1)

  • Recheck Cond: (share_to_org_id = 252,437)
  • Heap Blocks: exact=7,002
7. 7.764 7.764 ↑ 1.0 76,072 1

Bitmap Index Scan on inspections_purchaseordershare_share_to_org_id_c6418aa1 (cost=0.00..1,440.13 rows=77,827 width=0) (actual time=7.753..7.764 rows=76,072 loops=1)

  • Index Cond: (share_to_org_id = 252,437)
Planning time : 24.722 ms
Execution time : 11,873.358 ms