Fredrik Carlsson wrote:

It is a single PIII 500MHz, so i just changed thread_concurrency to 2 :), thanks

The slow query log don't show that many slow queries, but they did show alot of queries that was'nt using any index, can these queries cause some kind of occasional lock up?

Is there a faster way to perform this query?
(SELECT id,parent FROM art WHERE id=495098 ORDER BY date) UNION
(SELECT id,parent FROM art WHERE parent=495098 ORDER BY date);


explain show the following

+------------+-------+----------------------+---------+---------+-------+------+-----------------------------+

| table | type | possible_keys | key | key_len | ref | rows | Extra |
+------------+-------+----------------------+---------+---------+-------+------+-----------------------------+


| art | const | PRIMARY,id,id_2,id_3 | PRIMARY | 4 | const | 1 | |
| art | ref | parent | parent | 5 | const | 2 | Using where; Using filesort |
+------------+-------+----------------------+---------+---------+-------+------+-----------------------------+




Have you tried:

SELECT id,parent
FROM
   ((SELECT id,parent FROM art WHERE id=495098)
   UNION
   (SELECT id,parent FROM art WHERE parent=495098))
ORDER BY date;

You could also try adding an index on (parent, id, date) to speed up you second query.

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



Reply via email to