Welcome Guest, Not a member yet? Register   Sign In
I thought this stored procedure would be faster than plain selects
#3

(03-11-2018, 03:24 AM)InsiteFX Wrote: Could be the SELECT * try it with the column names instead and see if it speeds up.

Indeed, the following in particular looks bad:

(03-10-2018, 01:58 PM)skunkbad Wrote:
Code:
SELECT * FROM categories WHERE 1 = 0

Because you're doing a SELECT on a table, even it is obvious that no data would actually be selected (as nothing will satisfy 1 = 0), this likely results in a rowscan of the entire table.

And of course, if your PHP solution doesn't involve a temporary table, that's another thing that adds overhead.
Reply


Messages In This Thread
RE: I thought this stored procedure would be faster than plain selects - by Narf - 03-11-2018, 10:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB