Skip to content

primary key / unique behavior and index creation #50

Description

@tob123

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) ?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions