home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!paladin.american.edu!auvm!UTHSCSA.BITNET!BURNFIELD
- Original_To: DBASE-L
- Original_cc: BURNFIELD
- Message-ID: <DBASE-L%92112318235154@TECMTYVM.MTY.ITESM.MX>
- Newsgroups: bit.listserv.dbase-l
- Date: Mon, 23 Nov 1992 09:53:00 CDT
- Sender: "Discussion on the use of the dBase language and related
- dialects" <DBASE-L@NMSUVM1.BITNET>
- From: BURNFIELD@UTHSCSA.BITNET
- Subject: RE: Indexing Prohlem
- Lines: 34
-
- One approach is to look at your possible seek variables and see if there
- are any combinations that will come up more frequently than the others and
- build your indexes to more efficiently handle those cases. If the search
- criteria doesn't quite match your indexes then you may be able to use one
- of them eliminate a good portion of the database and use a WHILE loop to
- get at the rest of the records. For example, suppose you have an index
- whose expression is SSN+DTOS(date) and the user wants to search by SSN
- + organization + whatever. You could eliminate a great portion of the
- database by using the SSN+date index and soft seek on SSN. You could then:
-
- DO WHILE SSN = srchssn
- if DB->org = srchorg and DB->Whatever = srchwhatever
- ... process this record
- endif
- Enddo
-
- This way you wouldn't have to plan for every combination; however, you may
- be able to come up with some indexes that will contain at least one of the
- search items the user is looking for most of the time. If you get real lucky
- and 2 search fields match indexes you've set up, choose the one that will
- eliminate the most records.
-
- Another approach that you might consider is to index the database on the
- fly, based on the search criteria that the user entered and delete that
- file after it's no longer needed. The time you lose indexing might be made
- up when you seek. You'll probably want to do some time trials to see
- if this approach improves speed over what you're already doing.
-
- Hope this is of some use ...
-
- Dean Burnfield
- The University of Texas Health Science Center at San Antonio
- Internet address: burnfield@uthscsa.edu
- Bitnet address: burnfield@uthscsa
-