In case you have your own slow SQL query, you can optimize it automatically here.
For the query above, the following recommendations will be helpful as part of the SQL tuning process.
You'll find 3 sections below:
CREATE INDEX order_items_idx_deleted_at_order_id_sku ON "order_items" ("deleted_at","order_id","sku");
CREATE INDEX orders_idx_country_deleted_at ON "orders" ("country","deleted_at");
SELECT
"orders".id,
"orders".country,
"orders".total_items,
"orders".total_weight,
"orders".batch_id
FROM
"orders"
WHERE
EXISTS (
SELECT
*
FROM
"order_items"
WHERE
"orders"."id" = "order_items"."order_id"
AND "order_items"."sku" IN (
'104026'
)
AND "order_items"."deleted_at" IS NULL
)
AND "orders"."country" = 'Germany'
AND "orders"."deleted_at" IS NULL