Indexes efficiency
Posted in 2000
Leonids.Voroncovs@dati.lv — — source: Informix-list mailing list archive (1991-1998)
Hi All. Help needed.
Suppose we have table with heaps of documents:
CREATE TABLE heap (
...
series INT NOT NULL,
n_from INT NOT NULL,
n_to INT NOT NULL,
...
);I want to find a heap where document with given series and number lies:
SELECT * FROM heap WHERE series = :s AND :n BETWEEN n_from AND n_to;I'm thinking about two indexes:
CREATE INDEX idx1 ON heap( series, n_from, n_to );and
CERATE INDEX idx2 ON heap( series, n_to, n_from );
My questions:
1. Which index will be better (faster)?
2. How can i see an index using frequency in production environment?
Regards, Leonid.