Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Conditional Index?
Thu, Aug 18 2016 1:11 AMPermanent Link

Ian Branch

Avatar

Hi Team,
Latest Delphi & DBISAM.
I need to create conditional index where the field, e.g. Model, is sorted but only includes those that meet a condition, e.g. Make = Ford.

I can't find any reference such functionality in the docs.

Can do?

Regards & TIA,
Ian
Thu, Aug 18 2016 3:21 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian

>I need to create conditional index where the field, e.g. Model, is sorted but only includes those that meet a condition, e.g. Make = Ford.

I only have an old version of DBISAM so may be wrong, but I don't think there is such a capability. You can get sort of where you want by using a compound index eg from the pdf manual

CREATE INDEX CustDate ON Orders (CustNo, SaleDate DESC) COMPRESS DUPBYTE

Another alternative would be to create an extra column in the table and populate that with the data you want, but you're still indexing the entire table.

In both of the above you can use a filter/WHERE clause to limit the data to what you want.

The final option I can come up with is a separate table holding the selection/sorting data (if its meant to be variable use a memory table or create a temporary table using SQL) and then JOIN that to the table you're interested in.

If there's more information you can share we might be able to help further.

Roy Lambert
Thu, Aug 18 2016 4:04 AMPermanent Link

Ian Branch

Avatar

Hi Roy,
Thanks for the response.
Yeah, I had sorta come to the same conclusion.
I am converting a Clipper .dbf app to DBISAM and a table has an index of Make+Model for condition BLOCKED = True.  Just hoping I could get there simply.
Will probably just set a simple filter for BLOCKED = True when the particular index is required.

Cheers & thanks again,
Ian
Thu, Aug 18 2016 4:04 AMPermanent Link

Ian Branch

Avatar

Hi Roy,
Thanks for the response.
Yeah, I had sorta come to the same conclusion.
I am converting a Clipper .dbf app to DBISAM and a table has an index of Make+Model for condition BLOCKED = True.  Just hoping I could get there simply.
Will probably just set a simple filter for BLOCKED = True when the particular index is required.

Cheers & thanks again,
Ian
Fri, Aug 19 2016 9:57 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ian,

Sorry for not replying earlier - trying to get EWB 2.05 out this week, and it didn't want to go...

<< Can do? >>

As Roy indicated, no, you cannot.  However, it is pretty easy to simply do a compound index and then use a filter.  However, be sure to also add a *separate* index on the field referenced in the filter condition in order to allow for fast filtering.

Tim Young
Elevate Software
www.elevatesoft.com
Image