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

Postgres schema support partition table feature #424

Open
dhiaayachi opened this issue Sep 5, 2024 · 2 comments
Open

Postgres schema support partition table feature #424

dhiaayachi opened this issue Sep 5, 2024 · 2 comments

Comments

@dhiaayachi
Copy link
Owner

Is your feature request related to a problem? Please describe.
No.

Describe the solution you'd like
Most temporal sql query use shard_id as condition, for postgres database partition by hash is nice for large table.
Maybe some table partition number could be number of shards.

Describe alternatives you've considered
No.

Additional context
https://www.postgresql.org/docs/current/ddl-partitioning.html

@dhiaayachi
Copy link
Owner Author

Thank you for your feature request! It's great to hear about your interest in using table partitioning with Temporal.

While Temporal doesn't currently directly support table partitioning, you can explore other ways to achieve similar performance benefits. Here are a few suggestions:

  • Use Temporal's shard_id: You can leverage Temporal's shard_id in your SQL queries to distribute queries across different shards. This can improve query performance and scalability, especially with large datasets.
  • Implement a custom partitioning strategy: You can develop your own partitioning mechanism outside of Temporal. You could create a mapping between Temporal shard IDs and your chosen partitioning key, and use this mapping to distribute data and queries.

Please let us know if you have any further questions. We are always happy to help!

@dhiaayachi
Copy link
Owner Author

Thank you for the feature request!

While Temporal doesn't currently offer direct integration with PostgreSQL table partitioning, you can achieve similar results through:

  • Sharding: Temporal already leverages sharding, so you can use the shard_id in your SQL queries to filter data.
  • Custom Queries: Construct queries that combine Temporal's sharding with PostgreSQL's built-in filtering capabilities.

We value your input and will consider your suggestion for future improvements.

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