Subject Re: [firebird-support] Computed index for case insensitive queries
Author Mark Rotteveel
On Fri, 22 Aug 2014 01:18:17 -0500, "Caroline Beltran
caroline.d.beltran@... [firebird-support]"
<firebird-support@yahoogroups.com> wrote:
> I created the following computed index:
> CREATE INDEX IDX_FNAME ON PEOPLE COMPUTED BY (lower(fname))
>
> This works fine and instead of traversing the entire table when
performing
> a case insensitive query, an 'index read' for matching records is
> performed.
>
> The question I have is that the database management utility I use does
not
> show the true index DDL for my computed index. This is what the utility
> shows:
>
> CREATE INDEX IDX_FNAME ON PEOPLE();
>
> Is my database management tool not showing this correctly or is this
what
> the Firebird server returns?

Firebird server itself doesn't have any functionality to return the DDL of
database objects. It is up to tools to implement this themselves (eg like
isql does for its extract functionality). So probably your tool doesn't
support extracting computed indices. By the looks of it, it assumes that an
index always has one or more 'index segments' (the columns of the index),
and it doesn't look at RDB$SEGMENT_COUNT (value 0 indicates computed)
and/or RDB$EXPRESSION_BLR and RDB$EXPRESSION_SOURCE in table RDB$INDICES
to determine if it is a normal or computed index.

Mark