Skip to content

Add indexes on foreign keys in Reminders and SyncUp examples#317

Merged
mbrandonw merged 3 commits into
pointfreeco:mainfrom
jcmourey:add-foreign-key-indexes
Dec 2, 2025
Merged

Add indexes on foreign keys in Reminders and SyncUp examples#317
mbrandonw merged 3 commits into
pointfreeco:mainfrom
jcmourey:add-foreign-key-indexes

Conversation

@jcmourey
Copy link
Copy Markdown
Contributor

@jcmourey jcmourey commented Dec 2, 2025

Adds index to foreign-key columns in the SQLiteData Reminders and SyncUp examples, as Brandon requested in Slack. Good practice to help query performance.

Comment thread Examples/Reminders/Schema.swift Outdated
Comment on lines +233 to +239
try #sql(
"""
CREATE INDEX IF NOT EXISTS "idx_remindersListAssets_remindersListID"
ON "remindersListAssets"("remindersListID")
"""
)
.execute(db)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this one is not necessary because remindersListID is the primary key and so already indexed.

Copy link
Copy Markdown
Contributor Author

@jcmourey jcmourey Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood!

Copy link
Copy Markdown
Member

@mbrandonw mbrandonw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jcmourey!

@mbrandonw mbrandonw merged commit 90568d3 into pointfreeco:main Dec 2, 2025
@jcmourey jcmourey deleted the add-foreign-key-indexes branch December 2, 2025 16:45
bok- pushed a commit to bok-/sqlite-data-with-traits that referenced this pull request Dec 15, 2025
…eeco#317)

* Add indexes on foreign keys in Reminders and SyncUp examples

* idx_remindersListAssets_remindersListID is not necessary because remindersListID is the primary key and so already indexed.

* F**. fix last fix
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.

2 participants