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

slow select on RDB$PROCEDURE_PARAMETERS and RDB$FUNCTION_ARGUMENTS (index`s created on incorrect fields) [CORE6001] #6251

Closed
firebird-automations opened this issue Feb 17, 2019 · 10 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Segey Khalyutin (notesoft)

on table RDB$PROCEDURE_PARAMETERS index created on (RDB$RELATION_NAME,RDB$FIELD_NAME) instead of (RDB$PROCEDURE_NAME, RDB$PARAMETER_NAME)

on table RDB$FUNCTION_ARGUMENTS index created on (RDB$RELATION_NAME,RDB$FIELD_NAME) instead of (RDB$FUNCTION_NAME , RDB$FIELD_NAME)

in RDB$PROCEDURE_PARAMETERS RDB$RELATION_NAME and RDB$FIELD_NAME anywhere is null

in RDB$RDB$FUNCTION_PARAMETERS RDB$RELATION_NAME anywhere is null

@firebird-automations
Copy link
Collaborator Author

Commented by: Segey Khalyutin (notesoft)

on ver 3.0.5 this error too

@firebird-automations
Copy link
Collaborator Author

Commented by: @mrotteveel

I don't think the index is created on the wrong fields (because that index is relevant for TYPE_OF parameters), the problem is there is an index missing.

@firebird-automations
Copy link
Collaborator Author

Commented by: Segey Khalyutin (notesoft)

ok. In our db we add temporary index:

create index RDB$PROC_PARAM on RDB$PROCEDURE_PARAMETERS (RDB$PROCEDURE_NAME, RDB$PARAMETER_NAME);

if it possible, add like index in trunk.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

In Firebird index exists on three fields (RDB$PACKAGE_NAME, RDB$PROCEDURE_NAME, RDB$PARAMETER_NAME) and this is correct because all lookups should now consider a package name.

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Won't Fix [ 2 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @mrotteveel

While tools and people should consider package name, I would argue that a lot of tools (and probably also people) still don't. Maybe it would be better to remove RDB$PACKAGE_NAME from these indexes and give it its own? Or maybe add a separate on RDB$PROCEDURE_NAME as a form of accommodation.

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

System indices are primarily for speeding Firebird itself, not 3rd party applications. Having RDB$PACKAGE_NAME indexed separately is less optimal. Those who need something different may create custom indices, if required.

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

> In Firebird index exists on three fields (RDB$PACKAGE_NAME, RDB$PROCEDURE_NAME, RDB$PARAMETER_NAME) and this is correct because all lookups should now consider a package name.

Probably it make sence to set RDB$PACKAGE_NAME as last segment in this index ?

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

To drop/alter a package the better index would be one starting with the package name.

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

No branches or pull requests

1 participant