Hello ,

I'm working on a project with MySql 4.0.12-log.

I have a problem with insert .. select:
To describe the program of some touristic tours  I create two tables:
TOUR  that contains the data
TAPPE that contains the program of the tour.
(relation 1:n).

To keep track of each tour i create two tables (TOUR_A and TAPPE_A) very closed to the previous two but in tese tables there are also real dates.

Now I generate, with PHP, for each tour a set of records in table TOUR_A (1 record a week for a year) and copy the records from TAPPE to TAPPE_A adding dates and the ID of the record of TOUR_A.

Test case:
1 record in TOUR 2 records in TAPPE.  Generated 141 records in TOUR_A.

If I use "insert into TAPPE_A select ..... from TAPPE where TA_ID_TOUR=xx"
it takes about 25 seconds for 141+141x2 records.

If I use "select from TAPPE " and than "INSERT into TAPPE_A" in php with a loop it takes less than a second.

Does someone have had this problem?
It is a bug?

The tables have indexes on search fields.

Santino Cusimano




-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to