How to omit Open and Locate
Posted: Wed 13 May 2009 19:34
Hello!
I wrote an application that lets user select item from a grid (items are rows from an Oracle view). Grid has two important features:
1) Items can be sorted by all columns
2) After opening window with this grid, selected item has to be the same, which was selected when it was last closed
What my app id doing is:
1) Open TSmartQuery (with sorting made by using ORDER BY on Oracle side)
2) Find proper item using FindKey (app remembers primary key value of the last selected item)
And now the problem: everything was fine when there was 2000-5000 records in the Oracle view, but now there is about 25000 items (an will be much more in the future) and opening window with this grid takes up to 1.6 seconds. As I found Open takes 0.15-0.2 seconds, the rest is taken by Locate. It depends on selected item (the further it is in the order the longer it takes). Time is taken mainly by getting data of records between the first and the selected (needed to find the right one) from Oracle server. Is there any way to tell SmartQuery to open and locate record by its ID on the server side, then send data (selected record and few neighbour records visible in the grid) to client computer?
What I was thinkink of is expanding (I'm not sure if its the exact name, its the feature of ODAC that lets me get values of only few fields when I open dataset, and get rest of fields when I need it), but I need to show values of all fields in the grid. I couldn't figure out, how to make SmartQuery to do that (automatically expand rows that are visible in the grid).
Could you help me? If ODAC cannot solve my problem I will appreciate any other hints you would give me.
best regards
Jacek
I wrote an application that lets user select item from a grid (items are rows from an Oracle view). Grid has two important features:
1) Items can be sorted by all columns
2) After opening window with this grid, selected item has to be the same, which was selected when it was last closed
What my app id doing is:
1) Open TSmartQuery (with sorting made by using ORDER BY on Oracle side)
2) Find proper item using FindKey (app remembers primary key value of the last selected item)
And now the problem: everything was fine when there was 2000-5000 records in the Oracle view, but now there is about 25000 items (an will be much more in the future) and opening window with this grid takes up to 1.6 seconds. As I found Open takes 0.15-0.2 seconds, the rest is taken by Locate. It depends on selected item (the further it is in the order the longer it takes). Time is taken mainly by getting data of records between the first and the selected (needed to find the right one) from Oracle server. Is there any way to tell SmartQuery to open and locate record by its ID on the server side, then send data (selected record and few neighbour records visible in the grid) to client computer?
What I was thinkink of is expanding (I'm not sure if its the exact name, its the feature of ODAC that lets me get values of only few fields when I open dataset, and get rest of fields when I need it), but I need to show values of all fields in the grid. I couldn't figure out, how to make SmartQuery to do that (automatically expand rows that are visible in the grid).
Could you help me? If ODAC cannot solve my problem I will appreciate any other hints you would give me.
best regards
Jacek