Jump to content

Long SQL Queries


neugi

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
Link to comment
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.
Link to comment
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
Link to comment
Share on other sites

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.