Subject Re: [firebird-support] Re: SQL Performance problem
Author Alexandre Benson Smith
GrumpyRain wrote:

>Just be aware that views don't seem to use underlying table indexes
>even if they are available. We found an issue a while back where some
>reports openned within seconds at our office, but onsite where there
>was a lot more data, they were sluggish.
>
>Running IBPlanalyzer, you can see that any query on a view wont take
>advantage on an index on a field of that view, and so it suffers big
>performance penalties with lots of data. We now use stored procedures
>for a lot of things, as they can be made to use the underlying index.
>
>Your view appears to be simple, and based on the nulls in the query,
>there is no useful index that could be used for that query. You may
>want to normalise the SupplyLine table and create a relationship table
>between SupTran and SupplyLine, as well as a relationship table
>betweem PackSlp and SupplyLine.
>
>Good luck
>
>Adam
>
>
>
Adam,

I am not sure you are right here...

Views do use the index too...

In some cases (like views with agregates) it's not possible (in the
future I think this will be fixed) but as general rule, a query against
a view will use the same indices as if the query was against the
original tables.

see you !

--

Alexandre Benson Smith
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br