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

primary key / unique behavior and index creation #50

Open
tob123 opened this issue Mar 24, 2024 · 0 comments
Open

primary key / unique behavior and index creation #50

tob123 opened this issue Mar 24, 2024 · 0 comments

Comments

@tob123
Copy link

tob123 commented Mar 24, 2024

Hello,
django timescaledb seems to work fine. just 2 questions.
Timescaledb mentions no unique / primary key constraint is needed.
using your code i see that the primary key gets removed (e.g. no unique constraints, no primary keys) and again: that all seems to work fine.
However: django is quite explicit it needs a unique identifier based on a single column.
see for example here: https://docs.djangoproject.com/en/5.0/topics/db/models/#automatic-primary-key-fields

How is this uniqueness covered when using timescaledb ?

other question:
in order to have some speed letting django identify the instances(i tested on django admin with ~ 40 million rows) i created an index manually (raw sql) on the id column. That brings good performance. However I did not see id index management in your code. What are your thoughts, recommendations to get a good speed finding instances (for example in django admin) ?

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

1 participant