Subject Re: Grave problems with a big table
Author stefan_ziel
--- In ib-support@y..., Lele Gaifax <lele@s...> wrote:
> Hi all,
>
> I'm hitting a problem with Firebird that I'm not able to solve nor
to
> understand its nature.
>
> I have a moderately sized DB (~ 650Mb), that contains in particular
one
> big table with more than 1,200,000 (~ 300 Mb) records. Any
operation on it
> takes forever to complete... Almost everything was tried, from gfix
(that
> does not complain at all), to sweep/backup/restore, but none of them
> reached an and after a day! Operating on all other tables seems
working
> well...
>
> So, I tried to pump the big table into a clean db, but after that,
the new
> DB becomes unusable as well (... as bad!)
>
> Is there anything I can inspect to understand what is going on?
>
> thank you in advance,
> bye, lele.

Hi Lele,

I experimented a similar problem and the solution was an index.
Example:

create table big ( a integer, b integer, c integer, d date,
constaint big_pk primary key (a, b, c ) );

create index disturb on big ( a, d );

executing the statement

select * from big where a = 1 and b = 2 and c = 3

the optimizer used the index disturb and this took a lot of time.
droping the index the result was great - from 6s to 10ms - :-)

take a look at the PLAN

Stefan