vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi All, While i was going through mysql reference manual. I saw that "A query cannot be cached if it contains any of the functions shown below" BENCHMARK() CONNECTION_ID() CONVERT_TZ() CURDATE() CURRENT_DATE() CURRENT_TIME() CURRENT_TIMESTAMP() CURTIME() DATABASE() ENCRYPT() with one parameter FOUND_ROWS() GET_LOCK() LAST_INSERT_ID() LOAD_FILE() MASTER_POS_WAIT() NOW() RAND() RELEASE_LOCK() UNIX_TIMESTAMP() with no paramet- SLEEP() SYSDATE() USER() On my production server, the following query is being used. select * from student where regis_date=now(); Then what should i do so that the query get cached. Thanks, Prajapati |
| |||
| Hi, I need to write up a select statement something like: Select a.supcode,a.code,b.desc,sum(c.qty),c.dept where a.supcode=b.supcode and a.code=c.code and a.code=b.code and c.dept between $tring1 and $tring2. group by supcode This is fine but the problem is that there is duplicate supcode in a. When running this query I often have c values which does not relate to supcode. Anyone can help? Thanks Velen |
| |||
| Krishna Chandra Prajapati schrieb: > Hi All, > > While i was going through mysql reference manual. I saw that > > "A query cannot be cached if it contains any of the functions shown below" > BENCHMARK() > CONNECTION_ID() CONVERT_TZ() > CURDATE() > CURRENT_DATE() CURRENT_TIME() > CURRENT_TIMESTAMP() > CURTIME() DATABASE() > ENCRYPT() with one parameter > FOUND_ROWS() GET_LOCK() > LAST_INSERT_ID() > LOAD_FILE() MASTER_POS_WAIT() > NOW() > RAND() RELEASE_LOCK() > > UNIX_TIMESTAMP() with no paramet- > SLEEP() > SYSDATE() USER() > > On my production server, the following query is being used. > select * from student where regis_date=now(); > Then what should i do so that the query get cached. this would be like a time service would record once the current time, and than always just send this recorded time ... wired, not? -- Sebastian |
| |||
| Velen schrieb: > Hi, > > I need to write up a select statement something like: > > Select a.supcode,a.code,b.desc,sum(c.qty),c.dept where > a.supcode=b.supcode and a.code=c.code and a.code=b.code and c.dept > between $tring1 and $tring2. group by supcode > > This is fine but the problem is that there is duplicate supcode in a. > > When running this query I often have c values which does not relate to > supcode. yes, because c is JOINED by `code` and not by `subcode` with a "and a.code=c.code" -- Sebastian |
| |||
| On Mon, 10 Mar 2008, Krishna Chandra Prajapati <prajapatikc@gmail.com> wrote: > While i was going through mysql reference manual. I saw that > > "A query cannot be cached if it contains any of the functions shown > below" .... > NOW() > On my production server, the following query is being used. > select * from student where regis_date=now(); > Then what should i do so that the query get cached. <http://www.mysqlperformanceblog.com/2006/07/27/mysql-query-cache/> is a paper that explains a bit about MySQL caching. It starts First let me clarify what MySQL Query Cache is - I've seen number of people being confused, thinking MySQL Query Cache is the same as Oracle Query Cache - meaning cache where execution plans are cached. MySQL Query Cache is not. It does not cache the plan but full result sets. That appears to be an expansion of the official text at <http://dev.mysql.com/doc/refman/5.0/en/query-cache.html>, which is The query cache stores the text of a SELECT statement together with the corresponding result that was sent to the client. (6.0's page has the same sentence.) That leads me to think that the only way to cache the proposed query would be to stop time. Otherwise, the result of running NOW() will change from run to run, causing a different result set. -- Tim McDaniel, tmcd@panix.com |
| ||||
| Velen schrieb: > Hi, > > I need to write up a select statement something like: > > Select a.supcode,a.code,b.desc,sum(c.qty),c.dept where > a.supcode=b.supcode and a.code=c.code and a.code=b.code and c.dept > between $tring1 and $tring2. group by supcode > > This is fine but the problem is that there is duplicate supcode in a. > > When running this query I often have c values which does not relate to > supcode. yes, because c is JOINED by `code` and not by `subcode` with a "and a.code=c.code" -- Sebastian |
| Thread Tools | |
| Display Modes | |
|
|