Subject Re: [firebird-support] Ignore nulls in index?
Author Kjell Rilbe
Kjell Rilbe skriver:
>
> Mark Rotteveel skriver:
> > > Is it possible to make an index in FB ignore nulls? I mean, can the
> > > index be made to not store in the index those records with null in the
> > > indexed field?
> > >
> > > I have a 150 million table with some fields that will be 99% or more
> > > null, but in some situations I will have to lookup one specific record
> > > based on a non-null value of that field. Seems like such a waste to
> > > store all those nulls in the index... Without the index, the query
> takes
> > > about an hour, which is not acceptable.
> >
> > If 99% of the records do not have this field, would it not make more
> > sense to create a separate table for that field(s), and use the record
> > ID to join to the full table?
>
> Interesting proposition. This is a schema from an OO framework, but it
> allows a lot of tweaking and I could modify the model to get the mapping
> you describe. I will have to give this some thought. Thanks for the idea!

Heh, I can see at first glance that it's possible. For an association
thats single at both ends it's possible in ECO (the framwork) to choose
which end to embed in the object, i.e. which table will contain the
other table's PK. Apparently I've made a bad choise in this case. :-)

Regards,
Kjell
--
------------------------------
Kjell Rilbe
DataDIA AB
E-post: kjell.rilbe@...
Telefon: 08-761 06 55
Mobil: 0733-44 24 64


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