Mike Yearwood
Toronto, Ontario, Canada
General information
Category:
Coding, syntax & commands
Hey George, I've tried to duplicate your results, but I cannot. With the tag set I'm getting 36 seconds and without it I get .29 seconds. This has always been my experience. There was even a time when it was recommended that you SET ORDER TO 0 before running an SQL, but that's not necessary anymore. Here's how I created my table and how I tested the performance ... I hope I got the UT code formating stuff right.
*Create a million record speed testing table
set talk off
set echo off
create database speed
open database speed shared
create table large (field1 c(10), field2 i, field3 t)
CLEAR ALL
SELECT 0
use speed!large EXCL
m.field3 = datetime()
for lnI = 1 to 1000000
field1 = alltrim(str(m.lnI))
field2 = m.lnI
insert into large from memvar
next i
SET COLLATE TO "MACHINE"
index on field1 tag field1
index on field2 tag field2
index on field3 tag field3
clear all
and here's my test code...
*Do a bunch of searches for speed tests
SET TALK OFF
SET ECHO OFF
USE SPEED!LARGE excl
set deleted off
SET COLLATE TO "MACHINE"
*!* local lnI
*!* set order to field1
*!* a=seconds()
*!* for lnI = 1 to 10000
*!* seek "500000 "
*!* endfor
*!* ?seconds()-a
set order to
a=seconds()
for lnI = 1 to 100
locate for field1 = "500000 "
endfor
?seconds()-a
set order to field1
a=seconds()
for lnI = 1 to 100
locate for field1 = "500000 "
endfor
?seconds()-a
set deleted on
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only