rfr1tz
asked on
bind variables in php/mysql
Oracle has bind variables. Bind variables are used to avoid re-parsing requests. For example, if I say
"select * from someTable where number < 100"
and then
"select * from someTable where number < 5000"
the second query requires a complete reparse even though it is very nearly parsed 1 second ago. if 100 and 5000 could be handled by a variable of some type, the parsing could be skipped.
So does mysql have bind variables and can you use them with mysql.
"select * from someTable where number < 100"
and then
"select * from someTable where number < 5000"
the second query requires a complete reparse even though it is very nearly parsed 1 second ago. if 100 and 5000 could be handled by a variable of some type, the parsing could be skipped.
So does mysql have bind variables and can you use them with mysql.
ASKER
We had an Oracle consutant in here and he said we should use bind variables to increase performance by avoiding re-parsing. That's pretty much all I know about it.
The consultant was very smart though. I think he was probably correct.
The consultant was very smart though. I think he was probably correct.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Obviously, cost is why I want to use mySql whenever I can. mySql is constantly improving and hopefully it will soon be as good as Oracle.
Like many other software tools, Oracle has become so complex that you need consultants to come in and audit your installation. I doubt that many people have even heard of "bind" variables much less use them.
Like many other software tools, Oracle has become so complex that you need consultants to come in and audit your installation. I doubt that many people have even heard of "bind" variables much less use them.
Just a simple "WHERE number BETWEEN 100 AND 5000" would extend the query.
Or just "WHERE number < 5000 ORDER BY number" and process up to the point where number exceeds 100, and if necessary continue later.
I cant see any practical application of this, can you suggest one?