Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Xbase commands Vrs Sql commands
Message
From
10/05/2005 09:26:27
Suhas Hegde
Dental Surgeon
Sirsi, India
 
 
To
07/05/2005 16:23:53
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 6 SP5
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01011885
Message ID:
01012416
Views:
19
>>hi,
>>
>>I always find Xbase commands faster than Sql(statement) commands.
>>
>>
>>Any case where Sql statments are faster ?
>>Also i would like to know best prsctices where to use what ??
>>
>>
>>TIA
>>suhashegde
>
>Post a example where XBASE is faster.

Hi,

I have this problem.

the table is

create table bhav_data.dbf free ;
(symbol c(20),series c(20),open f(20,2),high f(20,2),low f(20,2),close f(20,2),;
last f(20,2),prevclose f(20,2),tottrdqty f(20,2),tottrdval f(20,2),timestamp c(20),date d,delqty i,delpercent f(20,2))

contains 266928 records
size 65,951 kb

test machine AMD k6 500mhz , 256 mb ram , 40Gb hd 5600rpm

It is index like

Index on timestamp tag t1
index on timestamp tag tq unique additive

cdx file size is 1,237 kb

when i use this sql

tt = seconds()
select dist timestamp from bhav_data into cursor test nofilter
?tt-seconds()

it runs at 0.819 sec returning 341 recs

and when i do

m.t1 = seconds()

use bhav_data in 0 order tq
create cursor test(timestamp c(20))
index on t1 tag t1
select bhav_data
scan for !seek(timestamp,'test','t1')
insert into test(timestamp) values(bhav_data.timestamp)
endscan

select test
locate && to set the record pointer to 1 as to compare case of sql
delete tag t1

?seconds() - m.t1

it runs in 0.288 sec returning 341 rec

Kindly tell me how can i still optmise the sql please ???

suhashegde
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform