Subject Re: [ib-support] view on a table to speed up queries
Author Jan Agermose
this idea of using a double index where one would other vise have used a
single index not knowing better:

1) is it a interbase thing or does it work on other database managers

2) is it "simple" to explain why it works?

3) does it always work or does it count on the on entry in the index to
have a very low selectivity. Is it possible to state a rule of thumb as
to some radio between the to columns in the index
0<logtype<40 and 0 < id <4,000,000 = big radio where as 0 < id 10,000
not so big :-) am I making any sense here?

Jan


On Mon, 2002-04-22 at 17:13, Helen Borrie wrote:

At 04:41 PM 22-04-02 +0200, you wrote:
>ups, the question is simply what is low-selectivity? The distribution of
>values?

Exactly right. The effect of an index of very low selectivity (like
logtype on its own) is to cause it to build very long chains of duplicates,
making for great depth and proliferation of index pages that have to be
searched.


>On Mon, 2002-04-22 at 16:34, Jan Agermose wrote:
>
> just to be sure. What is meant by low-selectivity and does it change
> (logtype, id) to (id, logtype). id being the primary key

No, FB/IB don't change indexes. Use (logtype, id) because, otherwise, you
might as well not use an index on logtype at all. (You could test that,
too...simply drop the index...it *might* be faster). Stranger things have
been known. :-)

--- H

All for Open and Open for All
Firebird Open SQL Database · http://firebirdsql.org ·
http://users.tpg.com.au/helebor/
_______________________________________________________



To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/






[Non-text portions of this message have been removed]