How can we get the record like "Multi scope"?

Post Reply
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

How can we get the record like "Multi scope"?

Post by dutch »

I've used Clipper5.2/FW2.5/Comix.

I would like to scope the databse by cmxSetScope(..,..) but some records is not the continue records.

example
-----------
Index on type+upper(name) tag ....
Type Name
----- --------------------
A John
A Jim
B Jonatan
B Sim
C Jane

How can I use scope to get all name with "J" from above index by do not use array, because the record is greater than 100,000 records.

Regards,
Dutch
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Post by dutch »

Dear Enrico,

I have 12 index tags with starting by "Type". If I create new set of index it means 24 index tags. I try to use cmFilter() but it is a little bit slow. Can I have another solutions.

Regards,
Dutch
User avatar
avista
Posts: 301
Joined: Fri Jun 01, 2007 9:07 am
Location: Macedonia

Post by avista »

What do you think about something like this ?

for i = 65 to 90
cKey := chr(i) + "J"
seek cKey
do while left(name,1) = "J"
....
enddo
next

Best Regards,
HunterEC
Posts: 723
Joined: Tue Sep 04, 2007 8:45 am

Solution to almost all your indexes.

Post by HunterEC »

Dutch:

Why don't you index on Name and create bitmaps for the Type field ?
You will have just one index and the same number of bitmaps as of types.
You'll reap the benefits of faster processing and less index maintenance. The only overhead (small) is when you add/update records that you have to update the bitmap for the particular type.

Remember to update / create the bitmaps when re-indexing or indexing your files.
Post Reply