Indexing

Posted: 2015-11-07 in Indexing

Indexing on a logical is not allowed for performance reasons.



if you really need to build the index you can convert the logical to a string, but we don’t recommend it unless there’s really no other way around it.



Q: 
LARGE table (over 4 millons records and over 1.5gb) with indexes.How do i replace te SET KEY TO xxx to get a similar performance? (and to get full index optimization)
A:
You can use SET FILTER, or you may find Virtual Tables to be helpful



Lianja will optimize on indexes when it can so in your case you just need to have an index on “country” and it will use that and not scan the whole table.
You can experiment using the “explain” command to see how it will perform the query.
So…
index on country tag country
Then…
explain select * from tablename where country=”USA”
Also worth noting is that Lianja will also use filtered indexes where possible.



Q:
In vfp you would define an index of type candidate. 
A:
Just use the INDEX ON command and the UNIQUE keyword, e.g. in the Console:
open database southwind
use employees
index on trim(lastname)+” “+firstname unique tag fullname
Or in SQL, specify the UNIQUE keyword in the CREATE INDEX command, e.g. in the Console:
create unique index sqlfullname on employees (trim(lastname)+” “+firstname)



You can index on logical fields – they just need to be converted to character first – use LTOS().



Q: 
How I can create a normal or production index for deleted records of lianja table?
A: 
Indexing on a logical is not allowed for performance reasons. 
index on etos(deleted()) to adu_del



Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s