15 Kwi
2005
15 Kwi
'05
00:54
Dnia 2005-04-14 20:13, hunter@mimuw.edu.pl napisał :
On Thu, Apr 14, 2005 at 07:13:32PM +0200, Wiktor R. Braun wrote:
Witam, proszę o pomoc w optymalizacji zapytania MySQL'owego. Aktualnie trwa zbyt długo... ~20 sek.
Taka sztuczka z mysqlem jest...
Dzięki za nakierowanie :) Teraz pomyka max ~2 sek. !! :D
DROP TABLE IF EXISTS tmp_users;
CREATE TEMPORARY TABLE tmp_users (INDEX (`usersid`)) SELECT users.id AS usersid FROM users LEFT JOIN nodes ON ( users.id = ownerid ) WHERE deleted = 0 AND users.creationdate < 1104534000 AND nodes.access = 1 GROUP BY users.id ORDER BY users.id;
DELETE FROM tmp_users USING tmp_users AS tmp, assignments AS assign WHERE tmp.usersid = assign.userid AND assign.suspended = 1;
--
Pozdrawiam, Wiktor R. Braun