Subject | Re: [firebird-support] best way to set statistics index on new database |
---|---|
Author | Martijn Tonies |
Post date | 2007-08-22T14:58:45Z |
Hi Bill,
I think L_INDEX could be smaller though, or do you have long metadata names?
:-)
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
> I have a user who creates his databases, creates tables, insertsWell, this is how I do it in production databases :-)
> initial data, and then wants to set the statistics on the indexes he
> just created. In PostgreSQL, he would issue the VACUUM DATABASE;
> command.
>
> Here is the what he came up with
>
> EXECUTE BLOCK AS
> DECLARE VARIABLE L_INDEX VARCHAR(100); DECLARE VARIABLE L_SQL
> VARCHAR(200); BEGIN
> FOR SELECT RDB$INDEX_NAME FROM RDB$INDICES INTO :L_INDEX DO
> BEGIN
> L_SQL = 'SET statistics INDEX ' || L_INDEX || ';';
> EXECUTE STATEMENT :L_SQL;
> END
> END
>
> This is ok, I guess. I wondered if there was a cleaner way to do this,
> though?
I think L_INDEX could be smaller though, or do you have long metadata names?
:-)
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com