Jump to content

Archived

This topic is now archived and is closed to further replies.

neugi

Long SQL Queries

Recommended Posts

Hi,

i got a sql query that takes about 350 sec.

my problem ist that after 60 sec my php script is sending again the same sql query again. also my PHP skript ist getting a Read Timeout. i used this function to extend the time, but it seems they dont work
@set_time_limit(400);
if (function_exists('apache_reset_timeout'))
apache_reset_timeout();

how can i stop this? or what is the best way to execute sql queries that take longer?

best

Share this post


Link to post
Share on other sites
May I ask what is taking so long? What are you possibly doing that would take 6 minutes to process on the database?

And are you starting the sending of the script every 60 seconds? You really need to change the execution time in the php.ini file.

Share this post


Link to post
Share on other sites
Hi,

here is the query

[code]INSERT INTO kompa(kompa.prod_id, kompa.model, kompa.typ_id, kompa.model_id, kompa.kompa_flag, kompa.engine_id, kompa.prod)
SELECT MODELS.PROD_ID, MODELS.NAME, MODELS.TYP_ID, MODELSKOMPA.MODEL_ID, MODELSKOMPA.KOMPA_FLAG, MODELS.ENGINE_ID, PRODUCER.NAME
FROM MODELSKOMPA, MODELS, PRODUCER
WHERE MODELS.MODEL_ID = MODELSKOMPA.MODEL_ID AND MODELS.PROD_ID = PRODUCER.PROD_ID
ORDER  BY MODELSKOMPA.MODEL_ID[/code]


MODELSKOMPA -> about 17.000 entries
MODELS -> about 17.00 entries
PRODUCER -> 600 entries

OUTPUT is simple all the data is put into a new database form which i will work on

best

Share this post


Link to post
Share on other sites

×

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.