Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there something faster than COUNT FOR?
Message
From
14/05/1998 11:46:32
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
14/05/1998 11:25:52
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00099443
Message ID:
00099452
Views:
20
>I need a fast COUNT for my table. Is there something faster than COUNT FOR? My code is COUNT FOR empty(mydate)... :)
Robert,
Keeping an index for mydate would make it fast. To make it faster you could use a filtered index expression and just count by setting order to it. Also keep a tag on deleted() (index on deleted() tag dummy). But IMO using SQL for counting is far better because it wouldn't move the rec pointer unnecessarily (still keep an index on mydate).
select cnt(*) from mytable where mydate={} into array aMyCount
return iif(type("aMyCount")= "U",0,aMyCount[1])
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
Reply
Map
View

Click here to load this message in the networking platform