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 counters_idx_counter_name_item_id ON counters (counter_name,item_id);
CREATE INDEX gourmet_idx_status ON gourmet (status);
CREATE INDEX photos_idx_main_photo_folder_id ON photos (main_photo,folder_id);
SELECT
count(*)
FROM
(SELECT
a.gourmet_id item_id,
a.gourmet_name_c item_name,
a.vendor_url external_url,
'fnf-item.aspx?pid=' || a.gourmet_id fun_taiwan_url,
b.photo_id,
coalesce(SUM(c.total_hit),
0) hit_count,
to_char(a.created_date,
'YYYY/MM/DD HH24:MI:SS') created_date,
'1' is_gourmet,
a.for_search_only,
a.area_code || '-' || a.tel_no tel_no,
a.tel_ext,
a.county,
a.town,
a.address_c,
'gourmet.png' icon_name,
now() AS updated_date,
'NonOrderScheduler' AS updated_by
FROM
gourmet a
LEFT JOIN
photos b
ON b.folder_id = a.gourmet_id
AND b.main_photo = '1'
LEFT JOIN
counters c
ON c.item_id = a.gourmet_id
AND c.counter_name = 'FnfHit'
WHERE
a.status = 'A'
GROUP BY
a.gourmet_id,
a.gourmet_name_c,
a.length_vendor_url,
a.vendor_url,
'fnf-item.aspx?pid=' || a.gourmet_id,
b.photo_id,
to_char(a.created_date,
'YYYY/MM/DD HH24:MI:SS'),
a.for_search_only,
a.area_code || '-' || a.tel_no,
a.tel_ext,
a.county,
a.town,
a.address_c) t