Re:SQL Performance Explained, the tuning book for developers...
by ThePadawan on Monday December 02, 2019 @02:22PM
(#21685832)
I sort of have a beef with the usage of "SQL performance". I know what people mean, but it still irks me.
SQL is a declarative query language. It describes the meaning of your query.
The execution of the query has performance implications based on the actual RDBMS and the semantics of the query, but you can't improve the performance of your query without altering its meaning, only the performance of its execution.
It's like when people describe the performance of Python when they mean the performance of the CPython runtime.
Re:SQL Performance Explained, the tuning book for developers...
by teh_klev on Monday December 02, 2019 @04:46PM
(#21687351)
Pro-DBA here. Not sure why you're being downvoted. I know what you're getting at. Different vendor SQL engines and query optimisers behave differently. There's isn't really a silver bullet for all database engines past the simple and obvious stuff like making sure columns you query most have indexes. Once you've exhausted these tuning options you really need to know your specific database engine's internals.
Re:SQL Performance Explained, the tuning book for developers...
by nomel on Monday December 02, 2019 @04:17PM
(#21687046)
> but you can't improve the performance of your query without altering its meaning
Could you explain what you mean by "meaning"? From my naive perspective, if different queries give the same results, in all cases, I would consider the "meaning" the same (silly shenanigans aside).
Re:SQL Performance Explained, the tuning book for developers...
by pdq on Monday December 02, 2019 @09:34PM
(#21689415)
Disagree. For example, indexes are an optimization mechanism which tune the SQL engine for your data set and queries. Creating and planning indexes are outside the scope of your SELECT query, but can give a dramatic performance difference, with the exact same SQL query.
https://use-the-index-luke.com/
SQL is a declarative query language. It describes the meaning of your query.
The execution of the query has performance implications based on the actual RDBMS and the semantics of the query, but you can't improve the performance of your query without altering its meaning, only the performance of its execution.
It's like when people describe the performance of Python when they mean the performance of the CPython runtime.
Could you explain what you mean by "meaning"? From my naive perspective, if different queries give the same results, in all cases, I would consider the "meaning" the same (silly shenanigans aside).
See also triggers.
No such thing.