Thanks very much to all who suggest me to use a JOIN
instead of the IN clause, which performances are very poor vs
join ones, as I read in
http://www.artfulsoftware.com/infotree/queries.php#568:
Both the |IN()| and |EXISTS()| queries have to execute a table scan
for each row in the table.
Performance degrades as the square of the number of rows.
The |JOIN| version builds its derived table on one table scan, and
quickly picks off its resultset from that.
My query now runs in less than 8 secs (the previous about 10minutes!!!)
I never see I forum where so much people offer their help.
Thank again very much to everyone!
Carlo
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]