Re: Some help with Optimization
Re: Some help with Optimization
- Subject: Re: Some help with Optimization
- From: Chuck Hill <email@hidden>
- Date: Thu, 9 Feb 2006 20:19:06 -0800
Hi,
On Feb 9, 2006, at 8:04 PM, Kieran Kelleher wrote:
A great feature to help you see the WHERE part of suboptimal
indices is the built-in EOAdaptorContextDelegate in Project Wonder.
Simply include ERExtensions framework and put something like this
in your Properties file.....
log4j.logger.er.extensions.ERXAdaptorChannelDelegate.sqlLogging=TRUE
######################################################################
###
# ERXAdaptorChannelDelegate
######################################################################
###
## Enable delegate to emit SQL debugging info. The Logger used is
## log4j.category.er.extensions.ERXAdaptorChannelDelegate.sqlLogging
er.extensions.ERXAdaptorChannelDelegate.enabled=true
## How long a statement must run to cause a log message. Messages
with longer than
## error also emit a stack-trace
er.extensions.ERXAdaptorChannelDelegate.trace.milliSeconds.debug=10
er.extensions.ERXAdaptorChannelDelegate.trace.milliSeconds.info=100
er.extensions.ERXAdaptorChannelDelegate.trace.milliSeconds.warn=1000
er.extensions.ERXAdaptorChannelDelegate.trace.milliSeconds.error=5000
## MaxLength of the message
er.extensions.ERXAdaptorChannelDelegate.trace.maxLength = 3000
## What entities to watch
er.extensions.ERXAdaptorChannelDelegate.trace.entityMatchPattern = .*
_________________________________________________
I use something similar inspired by this. It also has a threshold so
that it only logs slow fetches and also outputs the SQL. For low-
tech this is a mighty fine optimization tool!
One thing about EOModeler is that every attribute has optimistic
locking turned on by default. This creates big WHERE clauses which
can slow you down on non-indexed fields. My feeling is that
optimistic locking should be turned on on essential fields only and
then index those since WO _will_ use then in sql WHERE clauses.
I've heard this a number of times, but doubt that it is true. The
WHERE clause also includes the primary key. It seems to me that any
query optimizer worth its name should be able to grab that one row
and very quickly evaluate the rest of the WHERE conditions on it.
Chuck
--
Coming in 2006 - an introduction to web applications using WebObjects
and Xcode http://www.global-village.net/wointro
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems. http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden