Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Matching speed of browse for displaying all records
Message
From
05/08/1998 06:21:10
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00123816
Message ID:
00123990
Views:
18
>I give the option of displaying all patient names (approx 1500) in our database as a last resort to users. I tell them that this is the slowest method of searching for a patient. It takes about 3 seconds to display the entire list of names in a list control.
>
>The select is very simple:
>SELECT unique_id, patname from demogrph into cursor cAllPats
>
>This query takes about 3 seconds even though I have indexed on the field "patname". Doing a query that returns the complete results from a table seems redundant. How can I display (into a grid or list control) the fields from the table directly and thus decrease the 3 second query time to almost instantaneous?
>
>A BROWSE is quite efficient, can I harness this? It can display the fields I want (ordered too) almost instaneously.
Evan,
As Ed and David said here it's strange your query takes 3 seconds (deleted on and no index on deleted() ?). This one would be the fastest query for it has no filters. Might it be query is instant and the listbox populating takes time ? I would also suggest using a readonly grid instead (directly using the table as recordsource). For my patient records (over 50000 in most places) I use a grid with *ingrid* controls placed so the users can do an incremental search in grid + a thisform.refresh in afterrowcolchange provides a good search, display, edit combination (in fact I use thisform.removeobject(this.name) in valid of searchgrid - a popping grid in lower right corner of pat. rec. form). Related button click code and part of grid code is as follows :
* Listbutton.click
if !"NSCLASS"$set("CLASSLIB")
	set classlib to nsclass additive
endif	
thisform.addobject("Grid1","listelegrid")
thisform.grid1.visible = .t.
thisform.grid1.setfocus()
this.enabled = .f.
release classlib nsclass

* Listelegrid.valid
thisform.listbutton.enabled = .t.
thisform.removeobject(this.name)
* Listelegrid.afterrowcolchange
thisform.refresh
Grid class has its fields preset and positions itself in lower right corner in init. All its controls are ingrid (recordmark, deletemark .f. and scrollbars = vertical makes it an enhanced listbox).
BTW Do you have ICD9 in table form or do you know where it might be ? TIA.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform