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. I have the timeout set right now at 3
minutes. I can run this in phpMyAdmin and it usually takes 4-5 minuted
to complete. I do not want to have to make the client wait that long
for this. This is part of an import/export Excel function that I have
made. 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??? How do you export data from your databases like
this?
Thanks in advance,
-Chris 1 1836
cmgmyr wrote:
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. I have the timeout set right now at 3
minutes. I can run this in phpMyAdmin and it usually takes 4-5 minuted
to complete. I do not want to have to make the client wait that long
for this. This is part of an import/export Excel function that I have
made. 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??? How do you export data from your databases like
this?
If your query takes that long, do an EXPLAIN on it, and ask the good
people at comp.databases,mysql why this takes so long.
f'up comp.databases.mysql
--
Rik Wasmus This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Andy Levy |
last post by:
Hi
there is a function in phpmyadmin that exports all the data etc from a mysql
database to an sql text document, or Excel File.
I would like...
|
by: Lenz Grimmer |
last post by:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
MySQL 4.0.14, a new version of the popular Open Source/Free Software
Database, has been...
|
by: I.P. |
last post by:
No one has replied to my post.
----- Original Message -----
From: "I.P." <jancio_wodnik@wp.pl>
To: <mysql@lists.mysql.com>
Sent: Monday, August...
|
by: James Alexander Starritt |
last post by:
I also posted similarly in mailing.database.mysql
I have created a rather large (60 table database) website dealio in PHP that
works with MS SQL...
|
by: jlee |
last post by:
I'm pretty much a newbie on mysql, and I need some help.
I am running mysql Ver 12.22 Distrib 4.0.24, for portbld-freebsd5.4
(i386) on a server...
|
by: Ike |
last post by:
Recently, I began using a different MySQL verver (i.e. different machine as
well as different version#, going from 4.12a to 4.1.9 max).
The...
|
by: cwho.work |
last post by:
Hi!
We are using apache ibatis with our MySQL 5.0 database (using innodb
tables), in our web application running on Tomcat 5. Recently we...
|
by: rhepsi |
last post by:
Dear All,
Im vb.net 1.1,
When im trying to update the records from mysql to postgresql, the connection error:
the following code is Update...
|
by: rockdale |
last post by:
Hi, all:
My web application using MS EntLib for .net 2.0 (Jan 2006) to access
my backend database. It works fine with MS SQL 2k. Now we are...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
|
by: jalbright99669 |
last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was...
|
by: Matthew3360 |
last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function.
Here is my code.
...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
|
by: Carina712 |
last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
|
by: Rahul1995seven |
last post by:
Introduction:
In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...
| |