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
https://forums.phpfreaks.com/topic/9128-long-sql-queries/
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
https://forums.phpfreaks.com/topic/9128-long-sql-queries/#findComment-34234
Share on other sites

Archived

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

×
×
  • 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.