Subject rebuild primary key index?
Author gabrielsenkim
i'm testing a firebird 2.1.1 on windows.

I've created a table with some fields with different types and one column of type int which serves as a primary key.

For testing purposes i've ceated a script which inserts 1 millon rows in the table. the primary key is genereted in the process using a trigger and a generator. quite standard..

when i've loaded the script several times the query against the database runs markedly slower. is there a way to regenerte the indexes including the primary key?

is the a way to see the execution plan so i can se how the sql is executed?

I'm using the 'Select first 30 ..... ORDER BY record_id DESC' type of queries. when creating primary key indexes are they created as asc or desc by default? if they are created as asc it might be part of the problem.

best regards
kim gabrielsen