i reported this issue directly to vlad based on a customer database that we can not upload here
if have no idea why but executing these statements, each take about 2 minutes on a fast machine
ALTER DOMAIN BOOL DROP CONSTRAINT;
ALTER DOMAIN BOOL ADD CHECK (VALUE IN ('T', 'F'));
(checked with with another db with 500 generated tables and each
using a simlar domain 10 times, but this db much faster)
Vlad already told me that he found some not good defined system queries.
additional problem perhaps:
i do not know if it is the same problem, but for example on rdb$procedures, we do no longer have an index on rdb$procedure_name, only a combined index on
Some old code did a select on rdb$procedures joined it on RDB$PROCEDURE_NAME with a user based table for special userrights.
In fb <=25 it was very fast, in fb>=30 this part create a very bad crossjoin and when you have several thousands stored procs in the
database, it does not work well.
perhaps for compatibility reasons, there should be not only the combined index on tables that now have rdb$package
perhaps all systemqueries need a review based on this, and i also found that RDB$DEPENDENCIES does have a rdb$package column, but it has no index at all