CLEAR 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)) FOR K=1 TO 266928 APPEND BLANK REPLACE timestamp WITH STR(RAND()*10000) NEXT * contains 266928 records * size 65,951 kb Index on timestamp tag t1 FOR NOT DELETED() tt = seconds() index on timestamp tag tq unique ADDITIVE && !!!!!!! ? "distinct index build",seconds()-m.tt tt = seconds() * this query rebuild tq and copy timestamp into test select distinct timestamp from bhav_data into cursor test ? seconds()-m.tt,_tally m.t1 = seconds() use bhav_data in 0 order tq again ALIAS ttt && WHEN YOU OPEN THE tq INDEX, YOU DO DISTINCT USING THE PAST TIME !!!! create cursor test(timestamp c(20)) * index on timestamp tag t1 THIS IS USELESS select ttt * this scan uses tq !!! scan && for !seek(timestamp,'test','t1') THIS IS USELESS insert into test VALUES (ttt.timestamp) endscan USE select test locate && to set the record pointer to 1 as to compare case of sql * delete tag t1 ?seconds() - m.t1,reccount() * THIS IS OPTIMIZED INTO vfp9 : vfp9 = 4ms VFP8 = 500ms m.t1 = seconds() SELECT MAX(timestamp) FROM bhav_data INTO ARRAY DDDD ? SECONDS()-T1If VFPT optimize VFP10 for DISTINCT/GROUP BY/ORDER BY,