This topic is locked

Print data from different tables ( slow search )

9/15/2008 6:55:59 PM
PHPRunner General questions
J
johan-v author

Hello,
I would like to print data from 3 different tables.

I created a custom view with a join but this works very slow when searching data to print.

Also the ajax suggest is to slow.

Talking here about 10 to 20 seconds.

Searching on only one table works fast.
Anybody has some tip how to speed up the search with or without the custom view for the joined tables.
Here is a sql view of the joined tables.
SELECT

fiches_08_09_1ste_trim.f_id,

fiches_08_09_1ste_trim.c_id,

fiches_08_09_1ste_trim.c_leraar_id,

fiches_08_09_1ste_trim.periode,

fiches_08_09_1ste_trim.n01,

fiches_08_09_1ste_trim.n02,

fiches_08_09_1ste_trim.n03,

fiches_08_09_1ste_trim.n04,

fiches_08_09_1ste_trim.n05,

fiches_08_09_1ste_trim.n06,

fiches_08_09_1ste_trim.n07,

fiches_08_09_1ste_trim.n08,

fiches_08_09_1ste_trim.n09,

fiches_08_09_1ste_trim.n10,

fiches_08_09_1ste_trim.w01,

fiches_08_09_1ste_trim.w02,

fiches_08_09_1ste_trim.w03,

fiches_08_09_1ste_trim.w04,

fiches_08_09_1ste_trim.w05,

fiches_08_09_1ste_trim.w06,

fiches_08_09_1ste_trim.w07,

fiches_08_09_1ste_trim.w08,

fiches_08_09_1ste_trim.w09,

fiches_08_09_1ste_trim.w10,

fiches_08_09_1ste_trim.com01,

fiches_08_09_1ste_trim.r01n,

fiches_08_09_1ste_trim.r01w,

fiches_08_09_1ste_trim.r01p,

fiches_08_09_1ste_trim.ingevuld,

fiches_08_09_1ste_trim.schooljaar,

fiches_08_09_1ste_trim.leraar,

fiches_08_09_1ste_trim.filiaal,

fiches_08_09_1ste_trim.vak,

fiches_08_09_1ste_trim.graad,

fiches_08_09_1ste_trim.resultaat,

fiches_08_09_1ste_trim.leerling,

fiches_08_09_1ste_trim.studierichting,

fiches_08_09_1ste_trim.optie,

fiches_08_09_1ste_trim.volwassen,

fiches_08_09_2de_trim.n01 AS n011,

fiches_08_09_2de_trim.n02 AS n021,

fiches_08_09_2de_trim.n03 AS n031,

fiches_08_09_2de_trim.n04 AS n041,

fiches_08_09_2de_trim.n05 AS n051,

fiches_08_09_2de_trim.n06 AS n061,

fiches_08_09_2de_trim.n07 AS n071,

fiches_08_09_2de_trim.n08 AS n081,

fiches_08_09_2de_trim.n09 AS n091,

fiches_08_09_2de_trim.n10 AS n101,

fiches_08_09_2de_trim.w01 AS w011,

fiches_08_09_2de_trim.w02 AS w021,

fiches_08_09_2de_trim.w03 AS w031,

fiches_08_09_2de_trim.w04 AS w041,

fiches_08_09_2de_trim.w05 AS w051,

fiches_08_09_2de_trim.w06 AS w061,

fiches_08_09_2de_trim.w07 AS w071,

fiches_08_09_2de_trim.w08 AS w081,

fiches_08_09_2de_trim.w09 AS w091,

fiches_08_09_2de_trim.w10 AS w101,

fiches_08_09_2de_trim.com01 AS com011,

fiches_08_09_2de_trim.r01n AS r01n1,

fiches_08_09_2de_trim.r01w AS r01w1,

fiches_08_09_2de_trim.r01p AS r01p1,

fiches_08_09_3de_trim.n01 AS n012,

fiches_08_09_3de_trim.n02 AS n022,

fiches_08_09_3de_trim.n03 AS n032,

fiches_08_09_3de_trim.n04 AS n042,

fiches_08_09_3de_trim.n05 AS n052,

fiches_08_09_3de_trim.n06 AS n062,

fiches_08_09_3de_trim.n07 AS n072,

fiches_08_09_3de_trim.n08 AS n082,

fiches_08_09_3de_trim.n09 AS n092,

fiches_08_09_3de_trim.n10 AS n102,

fiches_08_09_3de_trim.w01 AS w012,

fiches_08_09_3de_trim.w02 AS w022,

fiches_08_09_3de_trim.w03 AS w032,

fiches_08_09_3de_trim.w04 AS w042,

fiches_08_09_3de_trim.w05 AS w052,

fiches_08_09_3de_trim.w06 AS w062,

fiches_08_09_3de_trim.w07 AS w072,

fiches_08_09_3de_trim.w08 AS w082,

fiches_08_09_3de_trim.w09 AS w092,

fiches_08_09_3de_trim.w10 AS w102,

fiches_08_09_3de_trim.com01 AS com012,

fiches_08_09_3de_trim.r01n AS r01n2,

fiches_08_09_3de_trim.r01w AS r01w2,

fiches_08_09_3de_trim.r01p AS r01p2

FROM fiches_08_09_1ste_trim

INNER JOIN fiches_08_09_2de_trim ON fiches_08_09_1ste_trim.c_id = fiches_08_09_2de_trim.c_id

INNER JOIN fiches_08_09_3de_trim ON fiches_08_09_1ste_trim.c_id = fiches_08_09_3de_trim.c_id
Thanks,

T
thesofa 9/15/2008

set up some indexes in the MySQL tables, usually this helps, define foreign keys makes things go faster too.