+1 just use a tool to get why it is slow. sirona, jamon are easy to set up or just use a profiler if you have time but not what id do first. supposing something is slow will just make you loose time, check what it is is what you need. Romain Manni-Bucau Twitter: @rmannibucau Blog: http://rmannibucau.wordpress.com/ LinkedIn: http://fr.linkedin.com/in/rmannibucau Github: https://github.com/rmannibucau
2014-04-04 13:21 GMT+02:00 Jean-Louis MONTEIRO <[email protected]>: > I tend to disagree with that. > Each part of a system has it's own goal and scope. > > Database is for data so I tend to use it as much as possible for sorting, > joining, etc, instead of relaying on Java for sorting collections or even > JPA to get a parent, then all childs, then all childs but applying a filter. > > But I would agree on the sense that each part (App Server, Database, etc) > must be tuned according to your SLA and the overall architecture. > So yes, take care of returning a large resultset to avoid heavy GC > workload, and check if you have an index and if it's used (explain in mysql > or any other database specific way to check the execution plan). > > JLouis > > > 2014-04-04 12:39 GMT+02:00 Howard W. Smith, Jr. <[email protected]>: > >> On Fri, Apr 4, 2014 at 5:46 AM, ivan nikitsenka <[email protected] >> >wrote: >> >> > >> > <query> >> > <description></description> >> > <query-method> >> > <method-name>findAll</method-name> >> > <method-params></method-params> >> > </query-method> >> > <ejb-ql>select object(o) from BreakReason o order by >> > o.reasonDesc</ejb-ql> >> > </query> >> >> >> Seriously? ORDER BY a 'reasonDesc'? >> >> Every now and then, I am opening jvisualvm (Java Visual VM) and profiling >> (or checking the performance) on certain parts of my app, and more and >> more, I am removing, >> >> ORDER BY ... >> >> from my queries, and reverting to Collections.sort() + Comparator. >> >> Is there an index on this 'reasonDesc'? What is 'reasonDesc'.length(), on >> average? >> >> If this is the reason why TomEE [and your app] is degrading, then please >> change your query, and remove the ORDER BY ..., and sort your data some >> other way. >> >> Refer to your database tuning document. I use Apache Derby, and they have a >> very nice/comprehensive 'Tuning Derby' guide that I have referred to in the >> past, when my app went to production. >> > > > > -- > Jean-Louis
