not prevent MySQL from being my favourite cup of database tea :)
Thanx!
George
- èçõîäíî ñúîáùåíèå -
Îò: Sinisa Milivojevic [EMAIL PROTECTED]
Òåìà: Re: Re: distinct / limit optimization
X Gogo writes:
Well, the order in which the queries are made doesn't matter. The query
Hi,
I've tried the folowing query:
SELECT DISTINCT column1 FROM table1 LIMIT 10;
and got the result for 0.23 sec.
Then I've tried the same query without limit:
SELECT DISTINCT column1 FROM table1;
and got the result for 0.01 sec. which is some 23 times
faster. There are about 1 rows
Well, Jeff you are right! I've just taken the
wrong line from .mysql_history file. It was one
of my thousands of tries to make the ORDER BY work
with UPDATE. What I really try to do is ORDER BY
the 'received' column, which is a timestamp.
The point is if I have plenty of alarm messages
which are
Hi!
The MySQL manual states that you can use ORDER BY in combination with the
UPDATE statement.
So I tried to use it, but it didn't work. Here is the sql query that's causing
the trouble:
mysql UPDATE alarms SET is_parsed=1 WHERE is_parsed=0 ORDER BY is_parsed LIMIT
1;
ERROR 1064: You have