Subject Re: [firebird-support] How to set database page size in embedded mode?
Author Helen Borrie
At 12:00 PM 17/08/2009, you wrote:
>I am migrating my project to Firebird 2.1.6

2.1.2?

>which runs in an embedded mode. I receive the following exception when trying to create an index on a large table column, such as VARCHAR(2048).
>
>org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544351. unsuccessful metadata update
>key size exceeds implementation restriction for index "IDX_1250473636589"
>
> From the documentation I understood that the maximum size of an index key is 1/4 of the database page size.

Correct - although the index key size will be more than the aggregated sizes of the key elements. A calculator is available at Ivan Prenosils site:
http://www.volny.cz/iprenosil/interbase/ip_ib_indexcalculator.htm

>However, I cannot figure out how to set the page size when running in embedded mode?

The page size is an attribute of the database itself, not contingent on what model of database access you are using. It can't be changed arbitrarily from your app, since the page size affects the entire layout of the database. You can *change* it by backing up the database and then restoring with a new page size.

To find out what the page size is currently, you can do a gstat -h. Most of the GUI tools also report various header attributes, including page size. If you want to know how to read it with .net provider code, ask on the firebird-net-provider list.

./heLen