"when i need sum the amount of the child table for each record in the primary table"
Fernando,
Are you using a program to do this or a query? A program will have a slower performance if you have to go to each record on the parent table and check for its links on the child table. But if you use an SQL statement performance can be sped up very nicely. I would do something like this:
SELECT parentable.client,SUM(childtable.moneyfield) FROM parentable,childtable GROUP BY parentable.client
You could also use the COUNT(*) command to actually count the number of transactions that generated the SUM() calculation.
HTH
>I have a application and it works :
>
>have one primary table with 1200 people Information
>and I have aprox. 30,000 records in a child table and is very
>slow consult the child table with a relation, when i need sum the
>amount of the child table for each record in the primary table, the system is very slow, i have index on IDCliente in my primary table and
>i have an Index in my child table Idcliente for make a relation and the relation works ok, but my sysetm is so slow, what I'm doing bad?
>how can a give more speed to my application?
>
>Sorry for my English
For every bug fixed, there is a bigger bug not yet discovered.