3 ms·
I think SQL views are a bit of a code smell. They're really only useful in my opinion as a hack, where creating a rather gruesome abstraction within the databas
by sonthonax 7y ago
I think SQL views are a bit of a code smell. They're really only useful in my opinion as a hack, where creating a rather gruesome abstraction within the database is easier than changing the query layer.
I'm currently working on a service written by a bunch of hipster developers who, wrote raw SQL in Python. And they wrote views, lots of really difficult to understand views that are self-joining (on JSON fields no less!). The performance is really unpredictable given the input sizes. It's the only time I'd call performance of a database chaotic because given an input size (beyond certain safe ranges) I have no idea what the performance is.
The problem is from my perspective a key bit of your application logic get hidden, you're then bound to migrations to change it.
- mgkimsal 7y ago> lots of really difficult to understand views that are self-joining (on JSON fields no less!) HOLY TAMOLE! You might have my story beat there. That's one level I didn't have to deal with. My sympathies!