Sql query vs xpath query ...........

liunx

Guest
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.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.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.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.
 
Back
Top