Skip to content

Conversation

@sdil
Copy link

@sdil sdil commented Jan 6, 2026

Motivation / Background

I'm trying to optimize table schema by addind index on both MySQL and Postgres adapter.

Details

I noticed that the SELECT query access pattern for the queue tables always has the WHERE acked = false and ORDER BY "offset" ASC clauses. For PostgreSQL, I added a partial index to optimize this query, and for MySQL, I added an index on this column.

Disclaimer: Claude Code helped me with this optimization.

Alternative approaches considered (if applicable)

N/A

Checklist

The resources of our team are limited. There are a couple of things that you can do to help us merge your PR faster:

  • I wrote tests for the changes.
  • All tests are passing.
    • If you are testing a Pub/Sub, you can start Docker with make up.
    • You can start with make test_short for a quick check.
    • If you want to run all tests, use make test.
  • Code has no breaking changes.
  • (If applicable) documentation on watermill.io is updated.

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

Successfully merging this pull request may close these issues.

1 participant