vazagothic
Programmer
Hello again,
in one my tables (1.6 million records) I have defined a concatenaded index:
INDEX ON county+owner TAG cty_owner
Now, I try to use a partial index value (just the county) and scan through the entire table looking for given county:
SET ORDER TO cty_owner
SET EXACT OFF
SCAN WHILE county+owner = "CountyNameHere"
[...] Code goes here [...]
ENDSCAN
The entire procedure took 984 seconds and found 324'000 matches.
Then I've added an additional index:
INDEX ON county TAG county
And I run the following program:
SET ORDER TO county
SCAN WHILE county = "CountyNameHere"
[...] Code goes here [...]
ENDSCAN
This procedure took ONLY 36 seconds to finish.
Now is my question:
How I can use the concatenated indexes (county+owner), without adding another index (county) to the file ?
I thought the concatenated indexes would run almost as fast as single value ones, but it was almost 30 times slower.
I believe the Rushmore optimization wasn't used at all, even after using the concatenated index structure.
in one my tables (1.6 million records) I have defined a concatenaded index:
INDEX ON county+owner TAG cty_owner
Now, I try to use a partial index value (just the county) and scan through the entire table looking for given county:
SET ORDER TO cty_owner
SET EXACT OFF
SCAN WHILE county+owner = "CountyNameHere"
[...] Code goes here [...]
ENDSCAN
The entire procedure took 984 seconds and found 324'000 matches.
Then I've added an additional index:
INDEX ON county TAG county
And I run the following program:
SET ORDER TO county
SCAN WHILE county = "CountyNameHere"
[...] Code goes here [...]
ENDSCAN
This procedure took ONLY 36 seconds to finish.
Now is my question:
How I can use the concatenated indexes (county+owner), without adding another index (county) to the file ?
I thought the concatenated indexes would run almost as fast as single value ones, but it was almost 30 times slower.
I believe the Rushmore optimization wasn't used at all, even after using the concatenated index structure.