Best way to tune substr,min,max query

2012-02-07 Thread Andrey Dmitriev
I have a query that I need to tune. Basically, substr a text, and select first and last entry. The table is currently a few million rows big. Index is on FromHost (text field) and ReceivedAt (index field) Is the best way to optimize my query. 1) create an index on substr() and the two date columns

Re: How to know the number of rows used in a SELECT MAX() query? FOUND_ROWS() not working.

2007-10-22 Thread Baron Schwartz
Hi, Daevid Vincent wrote: Is there a way to know how many rows were used in a computation? I tried this 'trick' but I still get 1, when I know that there are 3 rows used... SELECT SQL_CALC_FOUND_ROWS MAX(DATE_ADD('2007-10-18 18:04:45', INTERVAL user_access_hours HOUR)), MAX(access_expire)

How to know the number of rows used in a SELECT MAX() query? FOUND_ROWS() not working.

2007-10-22 Thread Daevid Vincent
Is there a way to know how many rows were used in a computation? I tried this 'trick' but I still get 1, when I know that there are 3 rows used... SELECT SQL_CALC_FOUND_ROWS MAX(DATE_ADD('2007-10-18 18:04:45', INTERVAL user_access_hours HOUR)), MAX(access_expire) FROM e

Re: Force max query time, or max records returned

2005-12-30 Thread nigel wood
Scott Baker wrote: Is there a way to tell mysqld to stop running a query if it hasn't completed in over 60 seconds? Or how about stop running if the result is greater 100,000 rows or something? I have a bone head user who keeps querying two tables and NOT joining them, and then dragging the D

Re: Force max query time, or max records returned

2005-12-30 Thread mos
At 04:31 PM 12/30/2005, Scott Baker wrote: Is there a way to tell mysqld to stop running a query if it hasn't completed in over 60 seconds? Or how about stop running if the result is greater 100,000 rows or something? I have a bone head user who keeps querying two tables and NOT joining them, a

Re: Force max query time, or max records returned

2005-12-30 Thread John Meyer
On Friday 30 December 2005 3:31 pm, Scott Baker wrote: > > How can I prevent this? > > Scott You know when I deal with users like this, I like to think about what Dennis Leary said about spanking children; "I don't need to spank them, I find that waving the gun around works just as well." -

Force max query time, or max records returned

2005-12-30 Thread Scott Baker
Is there a way to tell mysqld to stop running a query if it hasn't completed in over 60 seconds? Or how about stop running if the result is greater 100,000 rows or something? I have a bone head user who keeps querying two tables and NOT joining them, and then dragging the DB server down while i

MAX Query

2001-07-02 Thread Ben Smith
MAX() Query Hello, I'm trying to write 2 queries, the first to find the most recent club a player has played for, and then the previous club they played for. To find the most recent club i use this : substring(max(concat(STARTDATE,TEAM)),11,100) as TEAM which concats a players start da

Re: Max query size

2001-02-10 Thread Benjamin Pflugmann
Hi. On Tue, Feb 06, 2001 at 02:00:11PM +0100, [EMAIL PROTECTED] wrote: > Hello! > > I was wondering if anyone knows how big a qury can be in MySQL 2.23.14??? First 2.23.14 is not a known MySQL release. You probably mean 3.23.14. If so, you are still using an alpha release and should upgrade to

Max query size

2001-02-06 Thread Rune
Hello! I was wondering if anyone knows how big a qury can be in MySQL 2.23.14??? Rune Lanton - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archi