ODAC - speed

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
fire.tiger
Posts: 9
Joined: Thu 31 Jan 2008 20:29

ODAC - speed

Post by fire.tiger » Wed 19 Mar 2008 13:59

Hello,

I'd have one question. I have a table which has ~1 million of records
and I display these records using TOraQuery ( just a simple select statement). How to set up the query to have maximal speed, especially when sorting any column ? Runing the query is very fast, but sorting..it is slow.

Thank you.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 20 Mar 2008 08:53

If you sort data by clicking on a column header in TCRDBGrid component, or set IndexFieldNames property of TOraQuery manually, client side sorting is performed. This requires fetching all records to the client.

To speed up sorting, it should be performed on the server side by using ORDER BY in your SELECT statement. You can use SetOrderBy method of TOraQuery to add ORDER BY clause to your statement. If you are using TCRDBGrid, you should set dgeLocalSorting and dgeLocalFilter to False in OptionsEx property of TCRDBGrid.

Post Reply