explain.depesz.com

PostgreSQL's explain analyze made readable

Result: a1bI

Settings
# exclusive inclusive rows x rows loops node
1. 221.809 1,167.783 ↓ 252.9 64,484 1

Unique (cost=25,097.96..25,162.35 rows=255 width=2,608) (actual time=937.906..1,167.783 rows=64,484 loops=1)

2. 718.963 945.974 ↓ 252.9 64,484 1

Sort (cost=25,097.96..25,098.60 rows=255 width=2,608) (actual time=937.904..945.974 rows=64,484 loops=1)

  • Sort Key: kitchenbra0_.id, kitchenbra1_.id, kitchenbra2_.id, kitchenbra3_.id, timeperiod4_.day, timeperiod4_.from_time, timeperiod4_.menu_availability_setting_id, timeperiod4_.to_time, kitchenbra5_.id, kitchenbra7_.id, timeperiod8_.day, timeperiod8_.from_time, timeperiod8_.menu_availability_setting_id, timeperiod8_.to_time, kitchenbra9_.id, kitchenbra0_.entity_created, kitchenbra0_.version, kitchenbra0_.available, kitchenbra0_.order_workflow_id, kitchenbra0_.price, kitchenbra0_.tax_id, kitchenbra0_.tax_name, kitchenbra0_.tax_type, kitchenbra0_.tax_value, kitchenbra0_.updated_at, kitchenbra0_.variant_id, kitchenbra0_.variant_name, kitchenbra0_.variant_name_translations, kitchenbra0_.variant_value_id, kitchenbra0_.variant_value_label, kitchenbra0_.variant_value_label_translations, kitchenbra1_.entity_created, kitchenbra1_.version, kitchenbra1_.allowed_outside_combo, kitchenbra1_.description, kitchenbra1_.description_translations, kitchenbra1_.dynamics_id, kitchenbra1_.global_item_id, kitchenbra1_.image_uri, kitchenbra1_.menu_item_id, kitchenbra1_.menu_item_master_id, kitchenbra1_.name, kitchenbra1_.name_translations, kitchenbra1_.item_order, kitchenbra1_.out_of_stock, kitchenbra1_.station_id, kitchenbra1_.updated_at, kitchenbra2_.entity_created, kitchenbra2_.version, kitchenbra2_.availability_setting_id, kitchenbra2_.menu_category_id, kitchenbra2_.menu_category_master_id, kitchenbra2_.name, kitchenbra2_.name_translations, kitchenbra2_.category_order, kitchenbra2_.state, kitchenbra2_.updated_at, kitchenbra3_.entity_created, kitchenbra3_.version, kitchenbra3_.from_date, kitchenbra3_.menu_availability_setting_id, kitchenbra3_.open_all_day_friday, kitchenbra3_.open_all_day_monday, kitchenbra3_.open_all_day_saturday, kitchenbra3_.open_all_day_sunday, kitchenbra3_.open_all_day_thursday, kitchenbra3_.open_all_day_tuesday, kitchenbra3_.open_all_day_wednesday, kitchenbra3_.to_date, kitchenbra5_.entity_created, kitchenbra5_.version, kitchenbra5_.menu_id, kitchenbra5_.menu_master_id, kitchenbra5_.name, kitchenbra5_.name_translations, kitchenbra5_.state, kitchenbra5_.updated_at, kitchenbra7_.entity_created, kitchenbra7_.version, kitchenbra7_.from_date, kitchenbra7_.menu_availability_setting_id, kitchenbra7_.open_all_day_friday, kitchenbra7_.open_all_day_monday, kitchenbra7_.open_all_day_saturday, kitchenbra7_.open_all_day_sunday, kitchenbra7_.open_all_day_thursday, kitchenbra7_.open_all_day_tuesday, kitchenbra7_.open_all_day_wednesday, kitchenbra7_.to_date, kitchenbra9_.entity_created, kitchenbra9_.version, kitchenbra9_.abbreviation, kitchenbra9_.brand_dynamics_id, kitchenbra9_.category, kitchenbra9_.description, kitchenbra9_.image_uri, kitchenbra9_.logo_uri, kitchenbra9_.name, kitchenbra9_.state, kitchenbra9_.updated_at
  • Sort Method: quicksort Memory: 260,465kB
3. 28.096 227.011 ↓ 252.9 64,484 1

Nested Loop Left Join (cost=5,395.19..25,087.77 rows=255 width=2,608) (actual time=44.916..227.011 rows=64,484 loops=1)

4. 11.190 171.279 ↓ 66.8 4,606 1

Hash Join (cost=5,394.91..25,027.50 rows=69 width=2,240) (actual time=44.890..171.279 rows=4,606 loops=1)

  • Hash Cond: ((kitchenbra5_.kitchen_brand_id)::text = (kitchenbra9_.id)::text)
5. 43.047 160.056 ↓ 4.0 93,841 1

Hash Left Join (cost=5,378.87..24,950.00 rows=23,268 width=1,740) (actual time=44.806..160.056 rows=93,841 loops=1)

  • Hash Cond: ((kitchenbra2_.availability_setting_id)::text = (kitchenbra3_.id)::text)
6. 8.988 114.498 ↓ 2.5 16,033 1

Hash Join (cost=5,252.43..24,543.61 rows=6,304 width=1,580) (actual time=42.271..114.498 rows=16,033 loops=1)

  • Hash Cond: ((kitchenbra5_.availability_setting_id)::text = (kitchenbra7_.id)::text)
7. 8.751 105.221 ↓ 2.5 16,033 1

Hash Join (cost=5,223.35..24,497.87 rows=6,304 width=1,481) (actual time=41.973..105.221 rows=16,033 loops=1)

  • Hash Cond: ((kitchenbra2_.kitchen_brand_menu_id)::text = (kitchenbra5_.id)::text)
8. 6.992 96.111 ↓ 2.6 16,033 1

Hash Join (cost=5,182.84..24,440.87 rows=6,246 width=1,223) (actual time=41.608..96.111 rows=16,033 loops=1)

  • Hash Cond: ((kitchenbra2_.kitchen_brand_menu_id)::text = (poses6_.kitchen_brand_menu_id)::text)
9. 10.634 88.842 ↓ 1.4 16,042 1

Hash Join (cost=5,029.24..24,256.76 rows=11,552 width=1,142) (actual time=41.323..88.842 rows=16,042 loops=1)

  • Hash Cond: ((kitchenbra1_.kitchen_brand_menu_category_id)::text = (kitchenbra2_.id)::text)
10. 21.361 73.343 ↓ 1.4 16,042 1

Hash Join (cost=4,614.77..23,811.94 rows=11,552 width=884) (actual time=36.443..73.343 rows=16,042 loops=1)

  • Hash Cond: ((kitchenbra0_.kitchen_brand_menu_item_id)::text = (kitchenbra1_.id)::text)
11. 17.220 19.818 ↓ 1.0 20,628 1

Bitmap Heap Scan on kitchen_brand_menu_pos_items kitchenbra0_ (cost=787.57..19,932.19 rows=20,019 width=380) (actual time=4.236..19.818 rows=20,628 loops=1)

  • Recheck Cond: (((point_of_sale_id)::text = '798b53ed-9dc5-4f94-88a5-24b9e61d5dfe'::text) AND available)
  • Heap Blocks: exact=12,682
12. 2.598 2.598 ↓ 1.1 22,284 1

Bitmap Index Scan on idx_tmp_kitchen_brand_menu_pos_items_pos_id_available (cost=0.00..782.56 rows=20,019 width=0) (actual time=2.598..2.598 rows=22,284 loops=1)

  • Index Cond: ((point_of_sale_id)::text = '798b53ed-9dc5-4f94-88a5-24b9e61d5dfe'::text)
13. 16.324 32.164 ↓ 1.0 29,544 1

Hash (cost=3,461.22..3,461.22 rows=29,278 width=504) (actual time=32.163..32.164 rows=29,544 loops=1)

  • Buckets: 32,768 Batches: 1 Memory Usage: 12,299kB
14. 15.840 15.840 ↓ 1.0 29,544 1

Seq Scan on kitchen_brand_menu_items kitchenbra1_ (cost=0.00..3,461.22 rows=29,278 width=504) (actual time=0.008..15.840 rows=29,544 loops=1)

  • Filter: ((state)::text = 'ACTIVE'::text)
  • Rows Removed by Filter: 21,194
15. 2.665 4.865 ↓ 1.0 7,044 1

Hash (cost=326.43..326.43 rows=7,043 width=258) (actual time=4.865..4.865 rows=7,044 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 1,949kB
16. 2.200 2.200 ↓ 1.0 7,044 1

Seq Scan on kitchen_brand_menu_categories kitchenbra2_ (cost=0.00..326.43 rows=7,043 width=258) (actual time=0.004..2.200 rows=7,044 loops=1)

17. 0.046 0.277 ↓ 1.0 378 1

Hash (cost=148.91..148.91 rows=376 width=81) (actual time=0.277..0.277 rows=378 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 50kB
18. 0.199 0.231 ↓ 1.0 378 1

Bitmap Heap Scan on kitchen_brand_menu_point_of_sales poses6_ (cost=15.22..148.91 rows=376 width=81) (actual time=0.045..0.231 rows=378 loops=1)

  • Recheck Cond: ((point_of_sale_id)::text = '798b53ed-9dc5-4f94-88a5-24b9e61d5dfe'::text)
  • Filter: ((state)::text = 'ACTIVE'::text)
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=123
19. 0.032 0.032 ↑ 1.0 379 1

Bitmap Index Scan on idx_19852_fk_kitchen_brand_menu_point_of_sale_extract_point_of_ (cost=0.00..15.13 rows=379 width=0) (actual time=0.032..0.032 rows=379 loops=1)

  • Index Cond: ((point_of_sale_id)::text = '798b53ed-9dc5-4f94-88a5-24b9e61d5dfe'::text)
20. 0.194 0.359 ↑ 1.0 689 1

Hash (cost=31.89..31.89 rows=689 width=258) (actual time=0.359..0.359 rows=689 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 192kB
21. 0.165 0.165 ↑ 1.0 689 1

Seq Scan on kitchen_brand_menus kitchenbra5_ (cost=0.00..31.89 rows=689 width=258) (actual time=0.004..0.165 rows=689 loops=1)

22. 0.144 0.289 ↑ 1.0 715 1

Hash (cost=20.15..20.15 rows=715 width=99) (actual time=0.289..0.289 rows=715 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 102kB
23. 0.145 0.145 ↑ 1.0 715 1

Seq Scan on kitchen_brand_menu_availability_settings kitchenbra7_ (cost=0.00..20.15 rows=715 width=99) (actual time=0.006..0.145 rows=715 loops=1)

24. 1.051 2.511 ↓ 1.2 3,117 1

Hash (cost=93.45..93.45 rows=2,639 width=160) (actual time=2.511..2.511 rows=3,117 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 610kB
25. 0.965 1.460 ↓ 1.2 3,117 1

Hash Right Join (cost=29.09..93.45 rows=2,639 width=160) (actual time=0.336..1.460 rows=3,117 loops=1)

  • Hash Cond: ((timeperiod4_.menu_availability_setting_id)::text = (kitchenbra3_.id)::text)
26. 0.167 0.167 ↑ 1.0 2,639 1

Seq Scan on kitchen_brand_menu_availability_time_period_settings timeperiod4_ (cost=0.00..57.39 rows=2,639 width=61) (actual time=0.002..0.167 rows=2,639 loops=1)

27. 0.182 0.328 ↑ 1.0 715 1

Hash (cost=20.15..20.15 rows=715 width=99) (actual time=0.328..0.328 rows=715 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 102kB
28. 0.146 0.146 ↑ 1.0 715 1

Seq Scan on kitchen_brand_menu_availability_settings kitchenbra3_ (cost=0.00..20.15 rows=715 width=99) (actual time=0.008..0.146 rows=715 loops=1)

29. 0.003 0.033 ↑ 2.0 1 1

Hash (cost=16.01..16.01 rows=2 width=500) (actual time=0.033..0.033 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
30. 0.005 0.030 ↑ 2.0 1 1

Bitmap Heap Scan on kitchen_brands kitchenbra9_ (cost=9.38..16.01 rows=2 width=500) (actual time=0.030..0.030 rows=1 loops=1)

  • Recheck Cond: (((brand_id)::text = '60817b2f-b570-434a-968e-6b0b6f98c2a3'::text) AND ((kitchen_id)::text = 'f5244760-1a78-4b30-a0d4-db2177345e60'::text))
  • Heap Blocks: exact=1
31. 0.003 0.025 ↓ 0.0 0 1

BitmapAnd (cost=9.38..9.38 rows=2 width=0) (actual time=0.025..0.025 rows=0 loops=1)

32. 0.013 0.013 ↑ 1.0 20 1

Bitmap Index Scan on idx_19885_fk_kitchen_brand_brands (cost=0.00..4.43 rows=20 width=0) (actual time=0.013..0.013 rows=20 loops=1)

  • Index Cond: ((brand_id)::text = '60817b2f-b570-434a-968e-6b0b6f98c2a3'::text)
33. 0.009 0.009 ↑ 1.1 54 1

Bitmap Index Scan on idx_19885_fk_kitchen_brand_kitchens (cost=0.00..4.70 rows=57 width=0) (actual time=0.009..0.009 rows=54 loops=1)

  • Index Cond: ((kitchen_id)::text = 'f5244760-1a78-4b30-a0d4-db2177345e60'::text)
34. 27.636 27.636 ↓ 1.3 14 4,606

Index Scan using idx_19783_fk_kbm_time_perios_setting_kbm_availability_setting on kitchen_brand_menu_availability_time_period_settings timeperiod8_ (cost=0.28..0.76 rows=11 width=61) (actual time=0.004..0.006 rows=14 loops=4,606)

  • Index Cond: ((kitchenbra7_.id)::text = (menu_availability_setting_id)::text)
Planning time : 14.061 ms
Execution time : 1,184.611 ms