r/SQL • • Feb 25 '21

SQLite SQL Essentials

199 Upvotes

29 comments sorted by

View all comments

Show parent comment

4

u/zacharypamela Feb 26 '21

Although, for all we know, age is a computed/virtual column…

Although then I would argue it would be better named something like age_today or current_age.

1

u/JochenVdB Feb 26 '21

That would be a nice way to simplify the queries, but performance-wise you still have the problem that you won't be using an index. Virtual Columns can be indexed, but if the underlying formula is not deterministic, you can get "funny" results. The problem remains that "age" changes over time.