db: drop redundant user_id index on email_sends
The composite ix_email_sends_user_kind_sent (user_id, kind, sent_at) already satisfies leftmost-prefix WHERE user_id=? lookups on both MariaDB and SQLite, so the standalone per-column index was dead weight. Drop it before the migration ever lands in prod.
This commit is contained in:
parent
454df3ee0f
commit
51efccd3b1
2 changed files with 1 additions and 5 deletions
|
|
@ -328,7 +328,7 @@ class EmailSend(Base):
|
|||
|
||||
id: Mapped[int] = mapped_column(BigInteger, primary_key=True, autoincrement=True)
|
||||
user_id: Mapped[int] = mapped_column(
|
||||
ForeignKey("users.id", ondelete="CASCADE"), nullable=False, index=True,
|
||||
ForeignKey("users.id", ondelete="CASCADE"), nullable=False,
|
||||
)
|
||||
kind: Mapped[str] = mapped_column(String(16), nullable=False) # "daily" | "weekly"
|
||||
sent_at: Mapped[datetime] = mapped_column(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue