Welcome Guest, Not a member yet? Register   Sign In
ORM[suggestion]
#34

(09-24-2015, 04:37 PM)spjonez Wrote: In a large scale application an ORM quickly becomes one of your biggest bottlenecks. It's difficult to optimize indices for queries you aren't writing.

The queries an ORM will use are generated by code, which is, at the very least, predictable. If you understand the ORM's conventions, you should be able to determine its strengths and weaknesses in generating SQL, which will also help you determine when you need to override it and how to apply good indexes to your data. In the very worst case, you can always run some tests and determine what queries are generated.

We can (and should) write indexes based on the needs of the queries we are writing (or our code is writing) in an attempt to maintain the optimal performance of our database. However, it's not truly possible to optimize a database if you aren't making periodic adjustments based on the actual queries run by the database and analysis of how long those queries take to run and how often they are executed. Some databases provide better tools for gathering and analyzing this data than others.

As with any code, you should write SQL (and create tables and indexes) with an eye towards performance, but always beware of premature optimization. Optimization should be based on performance analysis, not prediction, because you could be wasting your time with a micro-optimization while your application is hanging on a query that just needs an additional index which is only required because of the way in which two different parts of the system use the same table.
Reply


Messages In This Thread
ORM[suggestion] - by ale-php - 12-22-2014, 10:37 AM
RE: ORM[suggestion] - by albertleao - 12-22-2014, 12:31 PM
RE: ORM[suggestion] - by libreteam_studio - 12-23-2014, 12:29 AM
RE: ORM[suggestion] - by twpmarketing - 12-23-2014, 10:40 AM
RE: ORM[suggestion] - by FaraonX - 12-23-2014, 01:35 AM
RE: ORM[suggestion] - by Avenirer - 12-23-2014, 04:43 AM
RE: ORM[suggestion] - by spjonez - 12-23-2014, 06:01 AM
RE: ORM[suggestion] - by davide.lucchelli - 03-16-2015, 02:52 AM
RE: ORM[suggestion] - by albertleao - 03-17-2015, 12:08 PM
RE: ORM[suggestion] - by spider - 03-17-2015, 12:47 PM
RE: ORM[suggestion] - by davide.lucchelli - 03-19-2015, 07:10 AM
RE: ORM[suggestion] - by corradom - 04-09-2015, 08:58 AM
RE: ORM[suggestion] - by ciadmin - 04-09-2015, 10:12 AM
RE: ORM[suggestion] - by marcogmonteiro - 04-14-2015, 10:19 AM
RE: ORM[suggestion] - by davide.lucchelli - 04-16-2015, 02:38 AM
RE: ORM[suggestion] - by marcogmonteiro - 04-16-2015, 12:01 PM
RE: ORM[suggestion] - by davide.lucchelli - 04-28-2015, 01:00 AM
RE: ORM[suggestion] - by intekhabrizvi - 05-05-2015, 01:23 AM
RE: ORM[suggestion] - by kimsal - 05-11-2015, 01:05 PM
RE: ORM[suggestion] - by ivantcholakov - 05-11-2015, 07:33 PM
RE: ORM[suggestion] - by dmyers - 05-12-2015, 07:54 AM
RE: ORM[suggestion] - by mwhitney - 05-12-2015, 01:37 PM
RE: ORM[suggestion] - by nobitacnt - 05-22-2015, 01:07 AM
RE: ORM[suggestion] - by Suren - 06-03-2015, 01:27 AM
RE: ORM[suggestion] - by Avram - 06-04-2015, 03:33 AM
RE: ORM[suggestion] - by Suren - 06-04-2015, 07:08 AM
RE: ORM[suggestion] - by Avram - 06-04-2015, 08:04 AM
RE: ORM[suggestion] - by Suren - 06-05-2015, 01:35 AM
RE: ORM[suggestion] - by maltyxx - 06-05-2015, 02:07 AM
RE: ORM[suggestion] - by davide.lucchelli - 06-10-2015, 09:15 AM
RE: ORM[suggestion] - by Lenza80 - 08-14-2015, 06:47 AM
RE: ORM[suggestion] - by ignitedcms - 08-15-2015, 03:15 AM
RE: ORM[suggestion] - by spjonez - 09-24-2015, 04:37 PM
RE: ORM[suggestion] - by mwhitney - 09-25-2015, 07:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB