Reputation: 5575
Is there any performance implications in sqlite of having a datefield
, and searching for records from a particular year, based on the year
attribute of the datefield
, as opposed to having a dedicated year
int
field, and searching based on that?
Upvotes: 0
Views: 16
Reputation: 1375
SQLite doesn't have a date type, so dates are stored in one of a few different formats, and calculations on those dates are performed using built in date functions. Those date functions will probably add some overhead, but whether that will actually have any performance implication really comes down to your data, the size of your db, etc.
The best thing you can do is run some of your own tests, then decide for yourself whether the performance gain you get from breaking the date into multiple columns is worth the added schema complexity.
Upvotes: 3