explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Vrx2

Settings
# exclusive inclusive rows x rows loops node
1. 0.126 32.403 ↓ 81.0 81 1

Sort (cost=11,320.03..11,320.03 rows=1 width=343) (actual time=32.398..32.403 rows=81 loops=1)

  • Sort Key: consultation_items.index, consultation_items.id
  • Sort Method: quicksort Memory: 55kB
2. 0.237 32.277 ↓ 81.0 81 1

Subquery Scan on consultation_items (cost=11,317.76..11,320.02 rows=1 width=343) (actual time=28.055..32.277 rows=81 loops=1)

  • Filter: (consultation_items.row_num = 1)
  • Rows Removed by Filter: 3,860
3. 3.716 32.040 ↓ 96.1 3,941 1

WindowAgg (cost=11,317.76..11,319.51 rows=41 width=361) (actual time=28.052..32.040 rows=3,941 loops=1)

4. 3.893 28.324 ↓ 96.1 3,941 1

Sort (cost=11,317.76..11,317.87 rows=41 width=314) (actual time=28.026..28.324 rows=3,941 loops=1)

  • Sort Key: consultation_items_1.external_sku, consultation_items_1.created_at
  • Sort Method: quicksort Memory: 1,113kB
5. 3.154 24.431 ↓ 96.1 3,941 1

Gather (cost=1,753.68..11,316.67 rows=41 width=314) (actual time=1.224..24.431 rows=3,941 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
6. 0.340 21.277 ↓ 77.3 1,314 3 / 3

Hash Left Join (cost=753.68..10,312.57 rows=17 width=314) (actual time=0.869..21.277 rows=1,314 loops=3)

  • Hash Cond: (pickups.owner_id = owners.id)
7. 0.450 20.874 ↓ 77.3 1,314 3 / 3

Hash Join (cost=737.04..10,295.70 rows=17 width=311) (actual time=0.796..20.874 rows=1,314 loops=3)

  • Hash Cond: (consultation_items_1.pickup_id = pickups.id)
8. 19.778 19.778 ↑ 1.1 1,388 3 / 3

Parallel Seq Scan on consultation_items consultation_items_1 (cost=0.00..9,554.62 rows=1,537 width=303) (actual time=0.080..19.778 rows=1,388 loops=3)

  • Filter: (((NOT remove_from_quote) OR (remove_from_quote IS NULL)) AND ((external_sku)::text = ANY ('{LR-00014,SF.DE.RU-149,"Clarus Mid Century Modern Coffee Table Glass Walnut","Hemingway End Table Satin Gold","Oscuro Cabinet Black",SF.FU.NS-16,"Beacon Floor Lamp Brass","York Table Lamp Brass",SF.FU.LA-32,"Yellow Pillow-RTO",SF.DE.PI-126,SF.DE.PI-60,SF.DE.RU-169,"Metal Small Vase Gold-RTO",LA.DE.PL-04,"hig Chesterfield Settee Gray","Kato Chair Mustard","Yolanda Dining Set For 4 Natural Walnut-","LA.FU.DR-01,DC.FU.DR-06",BR-00025,BR-00076,BR-00058,BR-00059,BR-00018,BR-00057,BR-00063,BR-00064,BR-00065,BR-00070,BR-00067,BR-00068,BR-00069,KI-00074,KI-00079,KI-00035,CS-00003,KI-00095,KI-00073,O-00008,KI-00051,KI-00055,KI-00044,KI-00101,O-00021,KI-00075,KI-00076,KI-00004,KI-00063,KI-00007,KI-00047,KI-00048,SF.DE.AR-263,SF.DE.AR-267,SF.DE.AR-271,SF.DE.AR-253,SF.DE.AR-328,SF.DE.AR-265,SF.DE.AR-261,SF.DE.AR-276,SF.DE.BP-11,SF.DE.BL-108,SF.DE.BL-122,"DC.DE.MI-50,BOS.DE.MI-06,SF.DE.MI-05,NYC.DE.MI-05",SF.DE.PI-167,SF.DE.TR-29,SF.DE.BOOK,SF.DE.TT-96,SF.FU.DR-03,SF.FU.DR-06,BA-00076,BA-00067,BR-00014,BR-00053,"Helix Queen Mattress 10\" White-RTO",BA-00049,BA-00030,KI-00104,CS-00011,KI-00100,BA-00025,KI-00013,BR-00048,LR-00015,KI-00096,KI-00022,SF.DE.PI-129,SF.DE.RU-43,SF.DE.RU-83,"Henry Metal Sonnet Platform Queen Bed Black & Natural"}'::text[])))
  • Rows Removed by Filter: 40,704
9. 0.046 0.646 ↓ 1.0 337 3 / 3

Hash (cost=732.87..732.87 rows=334 width=8) (actual time=0.646..0.646 rows=337 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 22kB
10. 0.558 0.600 ↓ 1.0 337 3 / 3

Bitmap Heap Scan on pickups (cost=6.88..732.87 rows=334 width=8) (actual time=0.059..0.600 rows=337 loops=3)

  • Recheck Cond: (owner_id = 23,769)
  • Filter: (id <> 31052)
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=173
11. 0.042 0.042 ↓ 1.0 338 3 / 3

Bitmap Index Scan on index_pickups_on_owner_id (cost=0.00..6.79 rows=334 width=0) (actual time=0.042..0.042 rows=338 loops=3)

  • Index Cond: (owner_id = 23,769)
12. 0.004 0.063 ↑ 1.0 1 3 / 3

Hash (cost=16.62..16.62 rows=1 width=11) (actual time=0.063..0.063 rows=1 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
13. 0.002 0.059 ↑ 1.0 1 3 / 3

Nested Loop Left Join (cost=0.57..16.62 rows=1 width=11) (actual time=0.058..0.059 rows=1 loops=3)

14. 0.035 0.035 ↓ 0.0 1 3 / 3

Join Filter: (users.owner_id = owners.id)) (cost=0..0 rows=0 width=0) (actual time=0.035..0.035 rows=1 loops=3)

  • Index Cond: (id = 23,769)
  • Heap Fetches: 3
15. 0.022 0.022 ↑ 1.0 1 3 / 3

Index Scan using index_users_owner_id on users (cost=0.29..8.30 rows=1 width=11) (actual time=0.022..0.022 rows=1 loops=3)

  • Index Cond: (owner_id = 23,769)
Planning time : 2.438 ms
Execution time : 32.665 ms