Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select lento
Message
From
04/03/2003 11:03:24
Cleber Ferrari
Capta Tecnologia
Brazil
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Select lento
Miscellaneous
Thread ID:
00760935
Message ID:
00760935
Views:
65
Pessoal,

Tenho um select conforme abaixo :
Select Code,Data ;
 FROM dc099;
 INNER Join curclientes On curclientes.codigo=Code;
 ORDER By Code,Data Desc;
 GROUP BY code;
 INTO Cursor curcoment
Ele busca dados da tabela abaixo especificada e de um cursor que tem apenas a coluna CODIGO. O cursor contém aproximadamente 400 códigos e a tabela DC099 tem aproximadamente 300 mil registros de 1000 códigos diferentes.

O select está demorando aproximadamente 25 segundos.

O select serve para recuperar a data do ultimo lançamento de cada código.

Alguém sabe como otimizar esta busca?
tabela DC099

CODE		 C(12	)
USER		 C(2	)
DATA		 C(8	)
TIME		 C(10	)
WCLAPP		 C(25	)
WCLREC		 C(25	)
FOF1		 C(80	)
FOF2		 C(80	)
FOF3		 C(80	)
FOF4		 C(80	)
FOF5		 C(80	)
FOF6		 C(80	)
FOF7		 C(80	)
FOF8		 C(80	)
FOF9		 C(80	)
FOF0		 C(80	)

Indices

 1 CODE+DATA+TIME+USER
 2 DATA+TIME+CODE
 3 DATA
 4 CODE
 5 SUBSTR(FOF1,1,1)
Next
Reply
Map
View

Click here to load this message in the networking platform