Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SET COLLATE question
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00357214
Message ID:
00359696
Views:
13
>>I have a two table join, one table (table1) holds only a record an the other (table2) holds 400.000 records, the match give me 400 records. The index are three numerical on both tables and the DELETED().
>>
>>Why if I index with a SET COLLATE TO "GENERAL" is faster (very far away) than if I do a SET COLLATE TO "MACHINE". I thought that MACHINE would be always faster than GENERAL?
>
>Hola Pablo,
>
>You don't tell us the whole story. If you want to change the collating sequence of an index, you first have to destroy it, then recreate if with the sequence you want. What happens when you do this?
>
I know this, :) I issued a DELETE TAG ALL and a INDEX ON , all this is done in the command window.

Don't mind this is a Carlos Yohn question and he solved it, the answer is in the newsgroup.

The original prg is:

** con este programa parece que se cae un poco la teoría comunmente
** aceptada de que la secuencia de ordenación 'machine' es siempre mas rápida
** que 'general'
** cuanto mas aumentemos el valor de 'tope' mas veremos la diferencia
** Hay que fijarse también que rushmore dice que está usando exclusivamente
** los índices en 'deleted()' y sin embargo afirma que el nivel de optimización es completo...

** ¿Hay algo que he pasado por alto ??

m.tope = 50

clear
close data all
set safety off
set talk on
set escape on
=sys(3054, 1)
select 0
create table muchos (campo1 n(3), campo2 n(3), campo3 n(2))
for c1 = 1 to m.tope
for c2 = 1 to m.tope
for c3 = 1 to tope
insert into muchos values (m.c1, m.c2, m.c3)
next m.c3
next m.c2
next m.c1
select 0
create table uno (campo1 n(3), campo2 n(3), campo3 n(2))
insert into uno values (15, 15, 15)
*
set collate to "general"
=consulta()
set collate to "spanish"
=consulta()
set collate to "machine"
=consulta()

function consulta
select muchos
delete tag all
index on campo1 tag campo1
index on campo2 tag campo2
index on campo3 tag campo3
index on deleted() tag borrados
select uno
delete tag all
index on campo1 tag campo1
index on campo2 tag campo2
index on campo3 tag campo3
index on deleted() tag borrados

m.inicio = seconds()
select all * ;
from muchos, uno ;
where uno.campo1 = muchos.campo1 ;
and uno.campo2 = muchos.campo2 ;
and uno.campo3 = muchos.campo3 ;
into cursor consulta
? set("collate") + ": "
?? seconds() - m.inicio
?? " Segundos"
return
Pablo Roca
Clavo Congelados, S.A. (La Coruna - Spain)
Sysop of PortalFox

Join MasFoxPro campaign
http://www.masfoxpro.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform