If your DB supports "bind variables" or parameterized queries you get SQL sort of like:
WHERE key IN (?, ?, ?, ?, ?, ?, ?, ?, ?) and the values are supplied afterwards. The DB server may be able to prepare for this query and run it faster the next time even if the actual values change because the SQL stays the same - just question marks. It is an optimization. John On Mon, Nov 16, 2009 at 10:49 PM, Ricardo J. Parada <[email protected]> wrote: > > When I tried it, the ERXInQualifier generated SQL for only the desired > values and without repeating the last one. Actually I did not set that > property, I used the padToSize in the constructor. And then I noticed that > the default padToSize comes from that property by looking at the > ERXInQualifier source code. > > Like I said, I don't know what the padding is for. I read the > documentation but it did not answer that to me. It mentions something about > bind variables and reducing the number of unique queries. But I still don't > get it. :-) > > Here it is: > > public *ERXInQualifier*(String > <http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html> key, > NSArray > <http://developer.apple.com/documentation/WebObjects/Reference/WO53_Reference/com/webobjects/foundation/NSArray.html> > values, > int padToSize) > > Constructs an in qualifer for a given attribute name and an array of > values. > > *Parameters:*key - attribute namevalues - array of valuespadToSize - the > size which is expected to be reasonable for this qualifier. If the NSArray > values has more than one element, the padToSize is used to round up the > number of elements and pad with nulls. Doing this reduces the number of > unique queries which result from having an arbitrary number of values. For > example, if the padToSize is 8, then we'll either have 1, or 8, or 16, or... > bind variables as compared to 1..., 2..., 3..., 4..., or ....16 > > > > On Nov 16, 2009, at 11:39 PM, Shravan Kumar. M wrote: > > Oh is it! I will try out this option today!!! > > Will changing this option as advised effect any other parts of Wonder/ > ERXtensions - "er.extensions.ERXInQualifier.DefaultPadToSize=1" > > Actually, due to this padding we had an SQL overflow once, but people did > not recognize that this was caused by ERXInQualifier duplication of > values... > > ------------------------------ > *From:* Ricardo J. Parada <[email protected]> > *To:* Shravan Kumar. M <[email protected]> > *Cc:* WO Dev Group <[email protected]> > *Sent:* Tue, November 17, 2009 2:12:05 AM > *Subject:* Re: ERXInQualifier bug - repeating last element extra 5 times > > Yes I noticed that too. I don't quite understand what the padding does but > I think you may set the following property to 1 and it may behave the way > you are expecting it: > > er.extensions.ERXInQualifier.DefaultPadToSize=1 > > > > _______________________________________________ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list ([email protected]) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/webobjects-dev/johnthuss%40gmail.com > > This email sent to [email protected] >
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
