Re: Query caching issue



Donkey Hot wrote:
flarosa <frank@xxxxxxxxxxxxxxx> wrote in
news:1188336563.702587.309240@xxxxxxxxxxxxxxxxxxxxxxxxxxx:

Thanks for the tip. The hit rate on my query cache is zero. I think I
see why. This statement appears at the very end of the query cache
discussion in the MySQL manual:

"No query that uses bind variables can be reused."

All my queries use bind variables -- I've been told for years that you
should always do prepared queries with bind variables instead of
sending your query as a literal string.

This sucks - what can I do?


Change MySQL to Oracle. It can reuse queries with bind variables. At least in C/OCI level.

But this switch maybe is not possible, then you have to cope with MySQL's limitations.

PostgreSQL will use prepared statements:
<http://www.postgresql.org/docs/8.2/interactive/sql-prepare.html>
<http://jdbc.postgresql.org/documentation/82/server-prepare.html>

--
Lew
.



Relevant Pages

  • Re: Connection between library cache latches and statistics?
    ... do many of the queries on these tables query against ... are the queries looking for values that did not exist two days ... I trace a SQL Server based connection to our DB ... Look for heavy parsing, use BIND variables". ...
    (comp.databases.oracle.server)
  • Re: Clarification on DBI module
    ... You get the same results for the second execute because the record buffer in the statment handle is not cleaned out because no execute took place. ... The sql query can have bind variables or they may not have. ... Ahhh...imagining that irresistible "new car" smell? ...
    (perl.dbi.users)
  • Re: Doing a query with string vs bind variables.
    ... performance of a query is worse if you do it with bind variables then ... if you do the same query as a string. ... situation is happening with many queries throughout our application. ...
    (comp.databases.oracle.misc)
  • Re: Question re: sql injection
    ... bind variables provide a systematic way to solve code injection. ... Bind variables allow me to write queries that are easy to develop and test ... The query I run interactively can be copied into code with no ...
    (comp.lang.php)
  • Re: Bind variables
    ... I have a session with a query very long ... SELECT SUM (glaa) "AA" ... AND globj < 800000 ... I can see the query there are bind variables ...
    (comp.databases.oracle.server)