explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wybm

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 5.519 ↑ 1.0 1 1

Aggregate (cost=23.91..23.92 rows=1 width=32) (actual time=5.519..5.519 rows=1 loops=1)

2.          

CTE merchantsinfo

3. 0.042 0.042 ↑ 1.0 7 1

Index Scan using merchants_pkey on merchants (cost=0.28..17.50 rows=7 width=129) (actual time=0.015..0.042 rows=7 loops=1)

  • Index Cond: (merchant_id = ANY ('{9e6f8f24-cae5-47d4-83c3-e14cc2607dea,5c5fb88b-c551-4c09-bbbb-8155b096bcc1,007ad1ac-b794-4c60-942a-a9765f49f639,f0d4cd05-4a63-40ee-9fdf-ab1c369b6ab0,004fdf3f-5bd8-4a6a-a902-58c81ce5ae50,440d5783-da0b-47e3-a757-c3e3ebf482f5,d3eee789-0c25-4916-b963-9060e412c631}'::uuid[]))
4. 0.000 5.516 ↓ 0.0 0 1

Nested Loop Semi Join (cost=3.31..6.14 rows=1 width=152) (actual time=5.516..5.516 rows=0 loops=1)

  • Join Filter: (merchantsinfo.active_offer = merchantsinfo_2.active_offer)
5. 0.000 5.516 ↓ 0.0 0 1

Nested Loop Semi Join (cost=3.31..5.91 rows=1 width=184) (actual time=5.516..5.516 rows=0 loops=1)

  • Join Filter: (stores.owning_merchant_id = merchantsinfo_1.merchant_id)
6. 0.000 5.516 ↓ 0.0 0 1

Nested Loop (cost=3.31..5.68 rows=1 width=184) (actual time=5.516..5.516 rows=0 loops=1)

7. 0.006 5.516 ↓ 0.0 0 1

Hash Join (cost=2.89..3.05 rows=1 width=152) (actual time=5.515..5.516 rows=0 loops=1)

  • Hash Cond: (merchantsinfo.merchant_id = stores.store_id)
8. 0.047 0.047 ↑ 1.0 7 1

CTE Scan on merchantsinfo (cost=0.00..0.14 rows=7 width=64) (actual time=0.017..0.047 rows=7 loops=1)

9. 0.645 5.463 ↓ 1,806.0 1,806 1

Hash (cost=2.88..2.88 rows=1 width=104) (actual time=5.463..5.463 rows=1,806 loops=1)

  • Buckets: 2,048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 265kB
10. 4.818 4.818 ↓ 1,806.0 1,806 1

Index Scan using stores_store_location_gist on stores (cost=0.28..2.88 rows=1 width=104) (actual time=0.138..4.818 rows=1,806 loops=1)

  • Index Cond: (store_location && '0101000020E610000079211D1EC27E52C030F0DC7BB8604440'::geography)
  • Filter: (('0101000020E610000079211D1EC27E52C030F0DC7BB8604440'::geography && _st_expand(store_location, '16093.4'::double precision)) AND _st_dwithin(store_location, '0101000020E610000079211D1EC27E52C030F0DC7BB8604440'::geography, '16093.4'::double precision, false))
  • Rows Removed by Filter: 564
11. 0.000 0.000 ↓ 0.0 0

Index Scan using offers_pkey on offers (cost=0.42..2.64 rows=1 width=32) (never executed)

  • Index Cond: (offer_id = merchantsinfo.active_offer)
12. 0.000 0.000 ↓ 0.0 0

CTE Scan on merchantsinfo merchantsinfo_1 (cost=0.00..0.14 rows=7 width=16) (never executed)

13. 0.000 0.000 ↓ 0.0 0

CTE Scan on merchantsinfo merchantsinfo_2 (cost=0.00..0.14 rows=7 width=16) (never executed)

Planning time : 0.716 ms
Execution time : 5.572 ms