Page 1 of 1

performance problem with second detail table and FB

Posted: Wed 20 Apr 2011 14:28
by inageib
Hello,
I use FB 2.5 and I notice performance degrade with he following senario:

1- I have a large table (A) with many foreign keys fields (about 14 FK)
2- I create a view to get names from lookup fields IDs
3- I used TIBCQuery to select * fields from that view
4- I also used another TIBCQuery to insert/update/delete records to original table
5- when I add a new record I use append and post then refresh both the original table (A) and the view (V)
6- this table (A) is considered a detail of another parent detail table (B) (level 2 detail)
7- the problem:
after I add a new record to table (A) and try to move the cursor between records in the parent detail table (B) I notice slow that take around 0.6~1 second until the highlight moves (I used a dbgrid)

I checked the indices statistics and found these result:
Image

Is this he reason, any way to improve performance of navigation ?

thanks alot[/img]

Posted: Thu 21 Apr 2011 07:57
by AndreyZ
Hello,

Every time you move the cursor in the master table, IBDAC requests data for the detail table from the server. You can set the IBCQuery.Debug option to True to display the statement that is being executed and investigate the IBCQuery behaviour. Note that you should add the IBDacVcl unit to the USES clause of any unit in your project to make the Debug property work.

Posted: Fri 22 Apr 2011 02:14
by inageib
Thanks alot, I tried that and found only ordinary select statements gets executed

after alot of further investigation it was a code inside lookup onchange even that fired up every time the record change , after fixing that code to execute only when needed every thing back normal again

Many thanks

Posted: Fri 22 Apr 2011 06:57
by AndreyZ
It's good to see that you've found a solution. If any other questions come up, please contact us.