Subject | Re: [firebird-support] Re: Index is corrupt |
---|---|
Author | Ann W. Harrison |
Post date | 2010-03-02T17:17:57Z |
svanderclock wrote:
comprised of key values and record numbers. Upper levels have key
value, record number, and a pointer to the next lower level with that
value, so the record number, which is always unique in a table, is
effectively part of the key. That reduces the cost of garbage
collection for duplicates, but doesn't eliminate all the problems
of index duplicates.
optimize a query. It won't help with the sorting, but if you can get
the result set down to a few thousand records, sorting isn't so bad.
using Firebird's API.
And yes, a cache size of 75 is nowhere near good enough for an insert
that affects 40 indexes. Each three level index should have at least
four pages in cache, plus a data page, plus a pointer page, a page
inventory page, and a few others.
Cheers,
Ann
>OK, that's very much like the female army generals ...
>
> yes, but let explain better the purpose of such index :
> for exemple index is the number of room in a house
> most of the house have 1, 2, 3.. 5 room
> very very few houses have 20 rooms
>Not a random number. The lowest level (zero) of the index has nodes
>
> i was thinking that now in FB 2 the dupplicate in index is not anymore a problem
> (especially because internally FB add a random offset to the value to internally
> unduplicate it) ... is it right ?
comprised of key values and record numbers. Upper levels have key
value, record number, and a pointer to the next lower level with that
value, so the record number, which is always unique in a table, is
effectively part of the key. That reduces the cost of garbage
collection for duplicates, but doesn't eliminate all the problems
of index duplicates.
>You are aware that Firebird can use more than one index per table to
>
>> Another approach is to eliminate all the compound indexes and put
>> ascending and descending indexes on individual fields.
>
> that is possible, i can concat in one simple Varchar field 2 or more column.
> at the end it's will not reduce the number of index, but increase the number
> of column in the table. do you really thing it's will help ?
optimize a query. It won't help with the sorting, but if you can get
the result set down to a few thousand records, sorting isn't so bad.
>I think you can set the cache size as a parameter on the attachment -
>> Basically, you're not going to get the performance you want unless
>
> hmmm, the cache size... was not thinging about it (actually it's to
> his default of 75 pages) ... you thing increasing it can help for the
> insert ? but how to do it for a specific connection (using the api) ...
> any doc about it?
using Firebird's API.
And yes, a cache size of 75 is nowhere near good enough for an insert
that affects 40 indexes. Each three level index should have at least
four pages in cache, plus a data page, plus a pointer page, a page
inventory page, and a few others.
>I don't know whether its bad or good, but it is interesting.
>>>> Are your bad nodes all level 1? Are any level 0?
>>
>
> aah yes you are right, it's written in the firebird.log and the bad nodes
> was at level 1 (is it bad or good?)
Cheers,
Ann