Victoria:

In response you wrote:

"> Also... if I run the same query twice.. first run and selecting
columns..
> then I run the same query but selecting COUNT(*).. does the second
time will
> run using MySQL's cache?

No. Queries should be the same, byte for byte, otherwise MySQL will
treat them as different queries."

Does this mean that MySQL does _not_ have the concept of a bind variable
and thus have to reparse any query that has parameter changes?

Thanks for your time.

Best Regards,
Boyd E. Hemphill
[EMAIL PROTECTED]
Triand, Inc.

Life is not a journey to the grave arriving safely in a well preserved
body, but rather a skid in broadside, thoroughly used, totally worn, and
loudly proclaiming:  "WOW!  What a ride!"

-----Original Message-----
From: Victoria Reznichenko [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 03, 2004 10:47 AM
To: [EMAIL PROTECTED]
Subject: Re: found rows in union

"Lorderon" <[EMAIL PROTECTED]> wrote:
> I'm running MySQL 4.0 and it doesn't support sub-queries...
> 
> I've checked and found that the next query returns rows of counting
each
> union part seperatedly and could make sum on its rows:
> (SELECT COUNT(*) FROM table WHERE id>100)  UNION ALL  (SELECT COUNT(*)
FROM
> table2 WHERE id>150)
> returns:
> +------------+
> | COUNT(num) |
> +------------+
> |        124 |
> |        912 |
> +------------+
> 
> When running the query without union, you could use
SQL_CALC_FOUND_ROWS even
> when having LIMIT, but this option not works when using union.. :(
> Is there anything like SQL_CALC_FOUND_ROWS in union? since I don't
want to
> run the query twice

SQL_CALC_FOUND_ROWS returns those number of rows for UNION that it
should be returned without _global_ LIMIT clause.

> Also... if I run the same query twice.. first run and selecting
columns..
> then I run the same query but selecting COUNT(*).. does the second
time will
> run using MySQL's cache?

No. Queries should be the same, byte for byte, otherwise MySQL will
treat them as different queries. 


-- 
For technical support contracts, goto
https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to