Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RECOMPILE PROCEDURE, RECOMPILE FUNCTION, RECOMPILE VIEW commands [CORE2472] #2885

Open
firebird-issue-importer opened this issue May 25, 2009 · 5 comments

Comments

@firebird-issue-importer

Submitted by: K. A. (parshua)

Votes: 11

One of major pains in updating many client databases in remote areas is recompilation of STORED PROCEDURES.

Having this feature will ease the incremental Metadata updates in remote sites without including their ALTER statements. Some databases may consist of thousands of SPs and having their ALTER commands in every new release will result in *HUGE* update scripts. Considering incremental nature of updates (in which a single updater file will update any version of the Metadata to the last version; this happens in live projects a lot) and the result will be a very big file. Having this feature will help over coming this problem.

Examle:
RECOMPILE PROCEDURE SP_TEST;
RECOMPILE FUNCTION F_TEST; (for PSQL functions)
RECOMPILE VIEW V_TEST;

If not possible to add the command to SQL, it may be possible to add this functionality through a system STORED PROCEDURE named SP_RECOMPILE:

EXECUTE SP_RECOMPILE('SP_TEST');

The STORED PROCEDURE will automatically find the type of object and create and execute the resulting alter statement to recompile the object.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 25, 2009

Commented by: K. A. (parshua)

I forgot to mention Triggers:

RECOMPILE TRIGGER TR_TEST;

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 25, 2009

Commented by: @asfernandes

And why do you do regular recompilations?

What problem you intent it to solve when you do?

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 26, 2009

Commented by: Cosmin Apreutesei (cosmin_ap2)

Procedures often need recompilation because of changes in other procedures, or whatever dependencies. I found oracle's behavior the best -- invalidate dependent procedures and triggers and let the programmer try to recompile them later -- a solution which implies the need for a RECOMPILE statement. I think this was requested in the tracker but I can't find it now.

As a side observation, IBExpert found a niche in solving those kinds of problems in the GUI that should be solved in the engine but require a hard time lobbying about (and developing, nonetheless). So you could give it a shot -- it has the options to recompile one or all procs and triggers.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 26, 2009

Commented by: @hvlad

Real issue is that procedure's\trigger's request stay in metadata cache until engine stop.
Such "recompile" could just mark current request instance in cache as obsolete. It will force engine to reload BLR and generate new execution tree at next reference.
This is something engine should (and can) do automatically. Unfortunately, current code in metadata cache seems not ready for such task.

We can continue discussion about it in architect list

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jun 26, 2013

Modified by: @dyemanov

Component: Engine [ 10000 ]

Version: 3.0 Initial [ 10301 ] =>

Component: ISQL [ 10003 ] =>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant