how to fasten setrange database?

i have huge database

but i create new field to setrange

for new field is type boolean false

so how i setrange it?

should i do something before setrange?

thanks

As per your question whatever i understand based on that i can say that You can use SetFilter to filter record based on that Boolean type filed by setting SETFILTER for that for value FALSE.

A bit info please stan. On what bases are you filtering it?

i already done that

for example i have 100.000 records

so i filter it using setrange for boolean type

so data i want to use just only 1 record

but it is very long-time

is there any idea how to solve it?

Hmmm i understand that you want to filter all the 100,000 record. if you are filtering it by boolean then you are considering a condition here. so what condition is that? maybe i can help if i know what condition it is!

Well, you should usually use SETCURRENTKEY so that the data is sorted on the same fields that you are filtering. That has its tradeoffs, though, as it will take slightly more time (usually negligible) during inserts and modifies.

the condition is that boolean type = false

boolean field named = Generated

so i filter it SETRANGE(Generated,false);

but still a bit too long for execute it…

fyi, the record that generated false only 1 or 2 records

I already

setcurrentkey (generated)

setrange(generated,false)

still long time the process

Then I would recommend using Client Monitor (if you are using SQL) to see where the bottle neck is.

or is it maybe because the database is too huge?

in that table is more than 100.000 records

When sorted correctly the query should run quickly. We have tables with millions of records that we query all the time. 100,000 records is practically nothing.

then i should know how to get… what “No.” from the posting …

because if i generated from the posted form… it doesn’t take a long time

As you say that its only 1 or 2 rec, then note those rec and call those alone in the posting via code. This way you can avoid the unwanted waste of time.

All…

i already solved this problem

i just add another setcurrentkey in my code

thanks for your sharing :slight_smile: