!= means not equal, for each of the 3 million records it's likely there are
almost 3 million records that are not equal, so you will end up with
9,000,000,000,000 results, this can take a bit of time. Especially if your
table is not indexed, and it has to search the whole table each time.
----- Original Message -----
From: "Augey Mikus" <mikus@stripped>
To: <mysql@stripped>
Sent: Wednesday, May 08, 2002 4:13 PM
Subject: Unnecessarily long query process time
> On one of my MySQL servers (Dell PowerEdge 800Mhz w/ 512MB RAM), I have
> a couple tables that have about 3 million records in each. However some
> of the records in the tables are duplicates of each other. Here is a
> query that should return the number of unique records for both tables:
>
> select count(*) from table1,table2 where table1.value != table2.value;
>
> However, this query has been running for more than 40 hours and still
> has not finished. Is this normal?
>
> Thanks,
>
> Augey
>
>
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail <mysql-thread108352@stripped>
> To unsubscribe, e-mail <mysql-unsubscribe-issvar=home.nl@stripped>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>