[wellylug] sql query so slooooooow
Bruce Hoult
bruce at hoult.org
Tue Nov 20 11:15:36 NZDT 2007
On Nov 20, 2007 11:12 AM, E Chalaron <e.chalaron at xtra.co.nz> wrote:
> Hi there
> I am trying a MysQl query, which seems to me relatively easy.
> I am trying that with command lines so far.
> So login to Mysql, select database and
>
> SELECT `task`.`name`, `project`.`name`, `task`.`date_closed` FROM task,
> project ORDER BY `task`.`name` ASC, `project`.`name` ASC,
> `task`.`date_closed` ASC;
>
> It seems to work but take ages and ages... a look at the processes list
> does show mysqld working.
> The database has a reasonable amount of data but nothing like GB of them.
Where's your WHERE clause?
That's going to get N * M result rows where N is the number of records
in task, and M is the number of records in project. That could be
quite a lot.
And lose the quotes unless you need them! (which you don't)
More information about the wellylug
mailing list