I have the following query being executed over DSN via odbc_connect in PHP:
SELECT Orders.Brand, Orders.AdFolder
FROM Orders
LEFT JOIN MPC_Agents ON Orders.UserName = MPC_Agents.UserName
WHERE Orders.AdFolder = '$udf'
When ran directly in MS Access the result is instantaneous. When ran via odbc_execute($conn, $query) it’s incredibly slow, but does execute after a while.
When the WHERE statement is taken out, it’s considerably quicker, despite when ran in the Access SQL console being the same speed as with the WHERE statement.
Can anyone help identify the issue?
To prevent the entire table being pulled by a query, it is important that you have suitable indexes.