3 ms·
Databases can be a black box from the developer perspective. This solution might perform differently across a number of variables: Database management solution
by Topgamer7 7y ago
Databases can be a black box from the developer perspective. This solution might perform differently across a number of variables:
Database management solution (sql server, postgres, mysql, etc)
Database version (mysql 5.6, 5.7, 5.8, mariadb, etc)
This method of finding whether your hunch works or not is the easiest alternative other than trying to read the code (or documentation, which many db engines have excellent documentation for this sort of thing).
- jimktrains2 7y agoExplain and explain analyze are very powerful tools for understanding query performance. http://www.postgresql.org/docs/9.4/static/using-explain.html http://www.postgresql.org/docs/9.4/static/using-explain.html (Blog post I wrote) http://jimkeener.com/posts/explain-pg http://jimkeener.com/posts/explain-pg
- Pxtl 7y agoHah, if versions were enough for consistent performance I'd be in heaven. I'm plagued by cases where the same schema with the same indices on same version of servers running on the same architecture gets different plans and performance.
- wbl 7y agoRegather the table statistics. If it was the same data I'd be shocked, but this isn't that surprising.
- DougBTX 7y agoFor SQL Server there’s a very nice article on making query plans more predictable here: http://www.sommarskog.se/query-plan-mysteries.html http://www.sommarskog.se/query-plan-mysteries.html
- cryptonector 7y agoIt's the price you pay for having a declarative language that lets the language implementation pick from a large universe of equivalent ways to actually compile and run the code. You now have to know how to tune the thing, and that requires having either specialist knowledge of the implementation in question, or the skills to find and apply that knowledge quickly. The value this provides is making development very agile (in the dictionary sense of the word).