-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Juleni wrote: > Hello Brent, > > Thanks for your answer, I have try to use clause SQL_CALC_FOUND_ROWS > within my SELECT query (and I also didn't use SELECT COUNT(*) ... query). > But when I used SQL_CALC_FOUND_ROWS and then I retrieved number of > all columns using SELECT FOUND_ROWS(), the performance was worse than > before (with SELECT COUNT(*) + SELECT ... LIMIT query). > > I have try to use also following construction (used FOUND_ROWS() as > the output from the query): > > select SQL_CALC_FOUND_ROWS > BF_USER.LOGIN_NAME, > BF_USER.EMAIL,BF_USER.ID, > BF_USER.MODIFICATION_DATE, > BF_USER.SUPER_USER, > BF_USER.GUEST_ACCESS_ENABLED, > FOUND_ROWS() > from BF_USER use index (LST_BF_USER_LOGIN_NAME) > where BF_USER.DOMAIN_ID=19 and > BF_USER.ID NOT IN(280) > order by BF_USER.LOGIN_NAME asc > limit 0, 20 > > But when I executed this command from JAVA, I have retrieved from > the column FOUND_ROWS() value = 1 ... but there were 1000 items within > the particular table and value has to be also 1000. > But when I executed the same command from a DB client, I have > retrieved from the column FOUND_ROWS() value = 1000. > It means, the same command returns me different values for > FOUND_ROWS() and it is conditioned by executing this command from JAVA > or from DB client (I have used SQuireL SQL Client).
Julian, Squirrel SQL also uses JDBC, so my guess is you're doing something different in your program compared to entering it via the client. FOUND_ROWS() is scoped by _connection_, are you sure you don't do anything with the connection between issuing the two queries (for example, calling commit(), or using the connection via a pool, and not having the same connection twice in a row?) -Mark - -- Mark Matthews MySQL AB, Software Development Manager - Client Connectivity Office: +1 708 332 0507 www.mysql.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBpfrYtvXNTca6JD8RAvMoAJ4zGU6NaOKkNtHv/6L+jz+6NZEJrACdEQfL tFhiX0JLyswBUU99VbIUZ84= =xLS3 -----END PGP SIGNATURE----- -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]