Click to See Complete Forum and Search --> : Sql query vs xpath query ...........


whisher06
01-27-2007, 09:37 AM
Hi.
I'm wondering what's the quickest way to
retrieve data ?
Example :
SQL
SELECT * FROM articles
Xpath

$xp = new domxpath($dom);
$titles = $xp->query("/articles");



Bye.

dougal85
01-27-2007, 02:11 PM
Well, I guess it depends. If the mySQL server is on the same machine etc.

Assuming it is, I'd think that the mySQL is faster. However, I'm not 100% sure.

Why not loop and do it 100 or even 1000 times and time the execution? Then you'll know for sure whats best for your setup.

whisher06
01-27-2007, 03:22 PM
Thanks so much for the ready reply.

Why not loop and do it 100 or even 1000 times and time the execution? Then you'll know for sure whats best for your setup.

Ok I'm trying it (I'm a little lazy ;I )

Bye.

Weedpacket
01-29-2007, 05:44 AM
It also depends on whether or not the data is stored in a relational database or an XML document. And that depends on what sort of data it is.