I have been asked to post my changes, please note that I consider this a quick fix or even a hack.
The basic idea behind it is that the ComparableResourcesPool used is specific to each database. In order to solve this the method getRequestedResourcePool() in RDBMSExpressionFactory was modified to check which RDBMS-adapter is used. To achieve that I hade to modify AbstractRDBMSStore to return the adapter, i.e. I added the method getAdapter(). I'm not sure this is a good solution, hence my designation of this as a hack. Finally I added the class MySql41ComparableResourcesPool, that is an extension of RDBMSComparableResourcesPool. The class is basically a copy of RDBMSComparableResourcesPool, but with a few small differences. The method getPool() check to see if a limit has been requested, if so it tries to retrieve objects matching the limit. Worth noting is that the SQL-query can return documents that the user doesn't have access to. So in order to get the right amount of documents the SQL-query is asked as many times as needed to get either the requested limit or until no more results can be found. The other major method that was changed is compileSQL(), this method was modified to include the "limit"-clause. Also, the retrieveObjects()-method where modified to take the current starting offset as a parameter, a parameter that is passed on to compileSQL(). I hope this desciption is good enough to understand the changes made and the logic behind those changes. Perhaps a seed has been planted so that someone can implement a more thought through solution. Best regards, Pontus > -----Original Message----- > From: Pontus Strand [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 18, 2005 10:04 AM > To: 'Slide Users Mailing List' > Subject: RE: Slide search performance issues > > > So I guess one wouldn't have to have an Exchange Server in order to > implement those extensions? I'm not too happy about using proprietary > extensions to a standard, but sometimes you have to be a > realist and accept > things... > > Anyway, we have solved to problem by modifying the source to > Slide. This is > not a good way to solve the problem, as upgrades to newer > versions of Slide > will be difficult but it was necessary to get the performance we need. > Basically what we did was to add a MySQL-specific > ComparableResourcesPool > that adds the keyword "limit" to the select statement. This > was a quick fix > to a serious problem so it not thought through all the way > yet so maybe we > will do something else in the future. > > Regards, > Pontus > > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > Sent: Monday, January 17, 2005 3:37 PM > > To: 'Slide Users Mailing List' > > Subject: AW: Slide search performance issues > > > > > > My favourite approach concerning this issue would be to > implement the > > MS-Exchange extension that adds the ability to specify to > > limit the result > > set by specifying ranges of results. > > This is described at the MS WebDAV pages as far as I > > remember. But it is not > > that easy to implement that on server side. But in fact would > > lead a big > > step towards Exchange compatibility... > > I know that everybody hates MS to extend the standards, but > > in the area of > > WebDAV they've added some useful bits. So why not adopt it? > > Some ranges could be mapped to sql commands by retrieving > > only the first > > rows, others could at least be filtered at java result set > > level. Any ideas? > > > > Cheers, > > Daniel > > > > > -----Urspr�ngliche Nachricht----- > > > Von: > [EMAIL PROTECTED] > > > > > [mailto:[EMAIL PROTECTED] > > pache.org] > > > Im Auftrag von Pontus Strand > > > Gesendet: Montag, 17. Januar 2005 08:22 > > > An: 'Slide Users Mailing List' > > > Betreff: RE: Slide search performance issues > > > > > > Ok, found the reason to why the query below didn't work, I > > had failed to > > > include a "group by"-clause. > > > > > > However, that doen't solve the problem. If I get lots of > > hits when doing a > > > search it still takes a long time to execute. What I would > > like to do is > > > to > > > move the limititation from the Slide server to the > > DB-server (where it > > > really belong). As I understand it the keyword "limit" > isn't part of > > > SQL-standard (Orcale for one doen't implement it) so I > > guess that this is > > > difficult do in generic terms. This is, however, important > > for us as we > > > need > > > the performance so which class/classes would I have to > > override in order > > > to > > > modify the behaviour of the search method? Is this > > recommended at all? Or > > > should we try to limit the client so we can't do to wide searches? > > > > > > /Pontus > > > > > > > -----Original Message----- > > > > From: Pontus Strand [mailto:[EMAIL PROTECTED] > > > > Sent: Friday, January 14, 2005 2:51 PM > > > > To: 'Slide Users Mailing List' > > > > Subject: RE: Slide search performance issues > > > > > > > > > > > > A quick follow-up, when working with large number of files > > > > the number of > > > > hits when doing a search could be large. As I understand it, > > > > it is possible > > > > to limit the number of responses by using the DAV:limit XML > > > > element from the > > > > DASL specification. However, the specification also states > > > > that the server > > > > may disregard the requested limit. So my questions are: Does > > > > Slide support > > > > DAV:limit? And will it work when using the > > > > "use-rdbms-expression-factory" > > > > parameter? And, finally, am I using correct syntax in the > > > > example below? > > > > > > > > <D:searchrequest xmlns:D =\"DAV:\"> > > > > <D:basicsearch> > > > > <D:select> > > > > <D:allprop/> > > > > </D:select> > > > > <D:from> > > > > <D:scope> > > > > <D:href></D:href> > > > > </D:scope> > > > > </D:from> > > > > <D:where> > > > > <D:and> > > > > <D:eq><D:prop><D:fileextension/></D:prop> > > > > <D:literal>xml</D:literal></D:eq> > > > > </D:and> > > > > </D:where> > > > > <D:limit> > > > > <D:nresults> > > > > 10 > > > > </D:nresults> > > > > </D:limit> > > > > </D:basicsearch> > > > > </D:searchrequest> > > > > > > > > The reason for my questions is that I can't get it to work > > > > and I can't find > > > > any references to this. Is there perhaps another way to limit > > > > the number of > > > > search hits? > > > > > > > > Regards, > > > > Pontus > > > > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] >
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
