4 ms·
I recall seeing some gnarly SQL at British Telecom over 2k lines. Id agree with you about keeping it as simple as possible
by C1sc0cat 6y ago
I recall seeing some gnarly SQL at British Telecom over 2k lines.
Id agree with you about keeping it as simple as possible
- hobs 6y agoPeople do dumb things with SQL, but depending on the query/set of columns, 2k is a pretty quick line count to reach. Just dont use select *, have a wide table, do more than a few trivial operations moving data around, and you'll get to 2k pretty quick. That being said, people do dumb stuff with SQL all the time; The worst query I have ever seen was 11MB, megabytes. The worst query plan I have ever seen generated a plan that was ~130MB. I regularly have people ask questions in #sqlhelp (https://sqlps.io/slack/ https://sqlps.io/slack/ SQL Server focused) like "Why can I only have 2100 parameters to a stored procedure?" (dude was super mad that I asked if his design might use some rework.)
- kthejoker2 6y agoI've told SQL learners before There is no Advanced SQL; there's only "a very large amount of SQL", "exotic SQL", and "SQL no one should have written."
- Pamar 6y agoAre you sure it wasn't either: + a stored procedure or + the end-product of an ORM tool?