explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UVRB : Optimization for: plan #n7Fv

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 6.136 4,153.984 ↑ 6.0 44 1

GroupAggregate (cost=20,505.15..20,513.73 rows=264 width=111) (actual time=4,147.757..4,153.984 rows=44 loops=1)

  • Group Key: lookup.county
2. 1.301 4,147.848 ↓ 2.3 596 1

Sort (cost=20,505.15..20,505.81 rows=264 width=104) (actual time=4,147.678..4,147.848 rows=596 loops=1)

  • Sort Key: lookup.county
  • Sort Method: quicksort Memory: 88kB
3. 3.555 4,146.547 ↓ 2.3 596 1

Nested Loop Left Join (cost=6.78..20,494.54 rows=264 width=104) (actual time=3.428..4,146.547 rows=596 loops=1)

4. 4,122.320 4,122.320 ↓ 544.0 544 1

Index Scan using orders_document_storage_created_at_date_index on orders_document_storage orders (cost=0.44..20,133.43 rows=1 width=89) (actual time=0.797..4,122.320 rows=544 loops=1)

  • Index Cond: (((created_at)::date >= (('now'::cstring)::date - 10)) AND ((created_at)::date <= ('now'::cstring)::date))
  • Filter: (((billing_address ->> 'country_code'::text) = 'US'::text) AND ((billing_address ->> 'province_code'::text) = 'FL'::text))
  • Rows Removed by Filter: 11094
5. 11.424 20.672 ↑ 264.0 1 544

Bitmap Heap Scan on _us_zip_county_lookup lookup (cost=6.34..358.46 rows=264 width=47) (actual time=0.035..0.038 rows=1 loops=544)

  • Recheck Cond: ((orders.billing_address ->> 'zip'::text) = zip)
  • Heap Blocks: exact=559
6. 9.248 9.248 ↑ 264.0 1 544

Bitmap Index Scan on _us_zip_county_lookup_zip_index (cost=0.00..6.27 rows=264 width=0) (actual time=0.017..0.017 rows=1 loops=544)

  • Index Cond: ((orders.billing_address ->> 'zip'::text) = zip)
Planning time : 5.259 ms
Execution time : 4,154.100 ms