Subject Re: [ib-support] Re: Index, several fields
Author Martijn Tonies
Hi,


> If I then have a rather large table (2 mio+ records) where is often do
> a select with the where claus:
>
> where
> (((MyField1*100)+MyField2))>SomeValue
>
> would I then gain something by either:
>
> 1.
> Making a compined index on those two fields alone ?
> Like this:
>
> create index MyIdx
> on MyTable (MyField1,MyField2);

No, as the fields aren't used to compare a value.

> 2.
> Make a new field in the table which is just a calculated fields
> ((MyField1*100)+MyField2) and then make an index on this new field ?

Yes.


With regards,

Martijn Tonies
Database Workbench - the developer tool for InterBase & Firebird
Upscene Productions
http://www.upscene.com

See you at the First European Firebird Conference in May in Fulda, Germany
http://www.firebird-conference.com

>
> Michael
>
>
> --- In ib-support@yahoogroups.com, "Martijn Tonies" <m.tonies@u...> wrote:
> > Hi,
> >
> > > Can I make a index on two fields in a table, where the condition is
> > > something like this:
> > >
> > > create index MyIdx
> > > on MyTable (((MyField1*100)+MyField2));
> >
> > No.