Hi I have to optimize query i have a less knowledge of sql plz help
SELECT SUM(creative.impressions_delta) AS deltaIMPS, SUM(creative.clicks_delta) AS deltaClicks, SUM(creative.actions_delta) AS deltaPCActions, SUM(creative.piactions_delta) AS deltaPIActions FROM advertiser, campaign, creative, access_control WHERE advertiser.asset_id = campaign.advertiser_id AND campaign.asset_id = creative.campaign_id AND advertiser.asset_id = access_control.asset_id AND access_control.asset_type = 'advertiser' AND access_control.menu_item = 'N' AND access_control.action = 'owner' AND access_control.network_id = 305
Run an explain query before and after creating the indexes and compare the costs. Theoretically, if the cost has gone down after creating the indexes, the query is more optimized. If the access_control table has a small amount of data in it, though, indexes may not be necessary.
That's the best I can do with the limited information provided!