I am having the following query and I am wondering how should I construct an index for each of the clients and products tables.
Code:
SELECT
clients.id AS id,
clients.name AS name,
COUNT(DISTINCT products.product_id) AS counts
FROM
clients
INNER JOIN
products ON (clients.id = products.client_id)
WHERE
CAST("2008-07-30"