Jump to content

Recommended Posts

Hey All,

I'm having a little problem with exporting data from my database. The problem is that the query seems to be too much for PHP and MySQL to handle since it is timing out. Here is the query:

SELECT p.id, p.base_no, p.style_no, t1.name AS category1, t2.name as category2, t3.name as category3, p.metal, p.description, c.name as collection, p.price, pe.b2c_desc, pe.meta_title, pe.meta_desc, pe.meta_keys, pe.alt_tag, p.site 
		FROM 
			categories AS t1
		LEFT JOIN 
			categories AS t2 ON t2.parentid = t1.id
		LEFT JOIN 
			categories AS t3 ON t3.parentid = t2.id
		INNER JOIN 
			products AS p ON t3.id = p.categories_id
		LEFT JOIN 
			collections AS c ON p.collection = c.id
		LEFT JOIN 
			products_extended AS pe ON p.style_no = pe.style_no

The categories table is a hierarchical setup (id, parentid, name). Do you guys have any ideas about how to make this function better? Any other solutions???

 

Thanks in advance,

-Chris

I know that I can do that, but I was looking for a more efficient way to handle this query. If there isn't a solution that way I can change the timeout as a last resort. I don't really want the client waiting 5 min to download/upload and XL file though.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.