TPS Auto Increments - Any speed advantage using Descending Key order?

If there is going to hundreds of thousands of records if not millions of records in a TPS file, and the ABC filemanager is used to do the auto incrementing, is there any advantage is using a Descending order on the AutoIncrementing key?

I don’t even know if a descending key works with an auto-increment setting?

I would probably just keep the auto-increment key in ascending order and add another descending key on the same field.

And, for that many records I’d probably be looking at an SQL database?

I can’t see that it would make any difference Richard.

In the case of an ascending key, in order to get the last key value used it would do a set/previous and in the case of a descending key a set/next.

So the same number of reads either way.

cheers

Geoff R

Yeah I can see in the abfile.clw the code which handles whether the keyfield is ascending or descending…

            GET(SELF.Keys.Fields,1)
            AutoIncField &= SELF.Keys.Fields.Field
            SET(SELF.Keys.Key)
            IF SELF.Keys.Fields.Ascend
              PREVIOUS(SELF.File)
            ELSE
              NEXT(SELF.File)
            END

but I was wondering if the order of indexes in the physical file are changed which would make it faster to get the info from the physical file.

This is working on the assumption that the windows api’s will always start at the beginning of the file, so its got less data to traverse in the physical file because the key field order alters the physical order of the key/index.

Edit.
Since switching the Auto Incrementing Primary Key with just RecordID as the field, from ascending to descending, over the last 24hrs I’ve been getting a lot of Auto Increment Errors, suggesting its not the most robust method for auto incrementing.

Considering the age and reasons for TPS, ie minimal disk usage and file handles, I don’t think there will be any marked difference in performance. That was was very much a secondary concern in the design. In fact in some ways the old DAT format could be faster.

I think the DAT could be faster, simply because its got seperate key/index files.