Subject | Re: Performance |
---|---|
Author | pokka_chi |
Post date | 2007-04-23T05:29:03Z |
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@...>
wrote:
Thanks very much for the link. It's very informative. The way that FB
handles index optimization means that my compound key of A, B and C
would not help FB very much because it will need to build a bitmap
for each of the condition for A, B, and C alone. So in my case,
there are around 1 million records for the condition (A>1) and the
same for (B>2) and (C>3). So it basically has to effectively scan
through the 1 million records to build bitmaps and "and" the bitmaps,
before knowing which 10 records are the first. Is my understanding
correct?
That doesn't sound very clever. If I have a unique compound key of
(A, B) and I want to locate a particular record, I would normally use
something like SELECT * FROM mytable WHERE A = 1 AND B = 2. Now if
there are 1 million records satisfying A=1 and another million
records satisfying B=2, then will FB need to read 2 million records
before finding the intersaction?
PK
wrote:
>Dear Helen,
> This would be a good place to start:
> http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_expert1
>
Thanks very much for the link. It's very informative. The way that FB
handles index optimization means that my compound key of A, B and C
would not help FB very much because it will need to build a bitmap
for each of the condition for A, B, and C alone. So in my case,
there are around 1 million records for the condition (A>1) and the
same for (B>2) and (C>3). So it basically has to effectively scan
through the 1 million records to build bitmaps and "and" the bitmaps,
before knowing which 10 records are the first. Is my understanding
correct?
That doesn't sound very clever. If I have a unique compound key of
(A, B) and I want to locate a particular record, I would normally use
something like SELECT * FROM mytable WHERE A = 1 AND B = 2. Now if
there are 1 million records satisfying A=1 and another million
records satisfying B=2, then will FB need to read 2 million records
before finding the intersaction?
PK