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

[Feature Request] In PosgresSQL indexes on foriegn key don't show up as indexes. #2440

Open
justinmclean opened this issue Mar 5, 2024 · 6 comments

Comments

@justinmclean
Copy link
Member

Version

main branch

Describe what's wrong

If you create a foreign key and index it doesn't show up as an index in the REST result.

Error message and/or stacktrace

N/A

How to reproduce

Using the playground, create an index on a foreign key like so:

alter table hr.employees add constraint FK_departments foreign key(department_id) references hr.departments(department_id);
create index on hr.employees(department_id);

Run this:

curl http://localhost:8090/api/metalakes/metalake_demo/catalogs/catalog_postgres/schemas/hr/tables/employees 

And indexes will be an empty array.

Additional context

No response

@justinmclean justinmclean added the bug Something isn't working label Mar 5, 2024
@FANNG1
Copy link
Contributor

FANNG1 commented Mar 6, 2024

seems not a bug, Gravitino currently supports PRIMARY_KEY and UNIQUE_KEY only

@justinmclean
Copy link
Member Author

In general foreign keys are much more common than primary or unique keys and provide important information on what fields are optimised to use in a query. Is supporting foreign key indexes or other indexes being considered?

@FANNG1
Copy link
Contributor

FANNG1 commented Mar 6, 2024

this's not scheduled in 0.5, maybe we could consider scheduling in 0.6

@justinmclean
Copy link
Member Author

The issue for that added indexes are a little misleading or could do with more description e.g. #1736 says "Support PostgreSQL index".

@justinmclean
Copy link
Member Author

The release notes for 0.4 are also a light on details on this https://github.com/datastrato/gravitino/releases/tag/v0.4.0

@yuqi1129
Copy link
Contributor

yuqi1129 commented Aug 1, 2024

We do not support foreign index for PG, I will schedule it to 0.7.0.

@yuqi1129 yuqi1129 added 0.7.0 Release v0.7.0 and removed 0.6.0 Release v0.6.0 labels Aug 1, 2024
@jerryshao jerryshao removed the 0.7.0 Release v0.7.0 label Aug 5, 2024
@FANNG1 FANNG1 removed the bug Something isn't working label Aug 7, 2024
@FANNG1 FANNG1 changed the title [Bug report] In PosgresSQL indexes on foriegn key don't show up as indexes. [Feature Request] In PosgresSQL indexes on foriegn key don't show up as indexes. Aug 7, 2024
@jerryshao jerryshao removed this from the Gravitino 0.7.0 milestone Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants