PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Jun 26, 2019 8:08 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Thu Jun 12, 2014 11:18 pm 
Offline
Forum Newbie

Joined: Thu Jun 12, 2014 10:56 pm
Posts: 1
Hi,

I've been using a simple but reliable technique to display data from a MySQL database on a website.
I perform one query and then iterate through the result, adding it to a DOM structure that is saved as an XML file.

This has been working great in the past with small amounts of data, but I now need to extract hundreds of thousands of rows from the database.
I'm not really happy with the performance of this. The query takes negligible time, but the PHP script still takes 1.5mins on a cloud hosted server or 25sec on an in-house server.

tl;dr
*100,000 rows MySQL -> XML using PHP (single query, loop through results)
*Want to explore alternative methods for performance increases


UPDATES:
I've done some profiling and, contrary to my recollection, it turns out the query itself is taking a long time.

Query executes in 81ms using Sequel Pro (which isn't limiting the query), but when I time the PHP script the query takes 25sec. (connection is fast, query takes time, preparing xml is fast)

Why would the query be taking 25sec in PHP, but 81ms using Sequel Pro?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Exabot [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group