Hi!

Which one is faster: PHP array_unique or SQL DISTINCT ?

I learned about the DISTINCT key word for SQL some time ago and remember that pro developers always told me that SQL is faster than code. I tested a slightly complex select query across three tables and used DISTINCT. The tables have each less than 1,000 records, two of the three have only about 600 rows. I let the query run for at least half an hour before I hit the reset button (PHP would have timed out much earlier). I then tested again but without any sorting, but that didn't make any difference. I then googled and some claim that DISTINCT isn't all that speedy.

Any advice is greatly appreciated.

David

_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to