Alaska Software Inc. - Does DbSort() uses memory only for sorting?
Username: Password:
AuthorTopic: Does DbSort() uses memory only for sorting?
Itai Ben-ArtziDoes DbSort() uses memory only for sorting?
on Thu, 28 Feb 2019 16:03:04 -0800
Hi,
Does DbSort() uses memory only for sorting?
My application crashes when sorting a large DBF (Aprox 1M records;
with a  memo field which is not part of the sorting process).

Thanks for the info.

-Itai
Anand GuptaRe: Does DbSort() uses memory only for sorting?
on Fri, 01 Mar 2019 10:55:30 +0100
Hi Itai,

Index is always advisable over dbsort. Though you must have a reason for sort,
try index and then copy to get same result. I do this way.

Regards,

Anand

Itai Ben-Artzi wrote in message news:f9tg7el271rgf5bl7l8um4th2644v281tt@4ax.com...
>Hi,
>Does DbSort() uses memory only for sorting?
>My application crashes when sorting a large DBF (Aprox 1M records;
>with a  memo field which is not part of the sorting process).
>
>Thanks for the info.
>
>-Itai
Itai Ben-ArtziRe: Does DbSort() uses memory only for sorting?
on Sun, 03 Mar 2019 12:56:26 -0800
Yes Anand, but replicating 1M records takes a long time.
If DbSort() is done in memory, I have no other choice but to index and
then copy all filtered records.
Thanks for the response, Anand.

-Itai
Andreas Gehrs-Pahl
Re: Does DbSort() uses memory only for sorting?
on Sun, 03 Mar 2019 21:07:40 -0500
Itai,

>If DbSort() is done in memory, I have no other choice but to index and
>then copy all filtered records.

DbSort() creates temp files, if necessary, so I can sort a database with 
over 1 million records that is about 1.8 GB in size (FOXDBE) without any 
runtime errors. And DbSort() is about 5 to 6 times as fast as creating an 
Index and then using DbExport() to copy the database.

But all Memo fields will be empty after DbSort()! The documentation states 
that: "Memo fields cannot be sorted." -- but it doesn't say that this means 
that Memo fields can't be copied.

So, if you need Memo fields in the sorted database, DbSort() can't be used, 
but you shouldn't get an error or crash, even with a large database.

And of course, what version of Xbase++, OS, DBE, etc. are you using and what 
kind of error (or crash) do you get and what does your code look like?

Just wondering...

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas@AbsoluteSoftwareLLC.com
web:   http://www.AbsoluteSoftwareLLC.com
[F]:   https://www.facebook.com/AbsoluteSoftwareLLC