Timeline for Good idea to move logic out of SQL statements?
Current License: CC BY-SA 3.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Aug 9, 2013 at 15:18 | comment | added | Stephen Byrne | @WarrenT, that's a fair point BUT if these functions are deterministic then why bother even caching, just calculate and store as data is created in the tables...I took the OP's question to be more along the lines of formatting code, which is a bad idea to have in your database - you are assuming that all of these applications would want the data they display to their users to be in the same format. Which means that for e.g. everyone in your overseas office has to see report dates as dd/mm/yyyy just because the database is localised to British English. Surely you can agree that this is madness? | |
| Aug 5, 2013 at 23:41 | comment | added | WarrenT | In some environments the application consuming the data may also be running on the server itself. Then the question becomes where is it more efficent to do formatting or other transforms. In some cases, especially where values repeat commonly, then it can be more efficient overall to let the server use a deterministic function once for each value encountered, and simply use the cached results, on subsequent occurrences of those values. Why have multiple applications all computing the same transform when the server can do it once for everyone. | |
| Jan 24, 2013 at 19:03 | review | First posts | |||
| Jan 24, 2013 at 19:07 | |||||
| Jan 24, 2013 at 18:45 | history | answered | Stephen Byrne | CC BY-SA 3.0 |