Delay closing resultsets

Brandon M. Reynolds bmr at comtime.com
Sat Sep 30 12:01:16 EDT 2000


Fernando Lozano wrote:
> The only workaround I got so far is to call
> Statement.setMaxRows(), but this way the user won't be able to see
> all results, and this is not desirable.
> 
> Any hints will be very apreciated.

I don't know whether or not there is bug here, but I wrote a search
engine and I had to address a similar issue.  Since I'm using HTML
to display my results, I just display a certain number of results
at one time.  I use 'SELECT TOP n name...' where n keeps growing as
the user proceeds to look at more results.  I just skip the rows that
they have already seen by fetching them but tossing them.  Of course,
the pages will get slightly slower to load as the user proceeds.  But
because my search is weighted, I'm assuming they're not going to want
to look at any page beyond 2 or 3 most of the time.  Normally they will
refine they search criteria.

If you are using a more windows-type setting, then maybe you could load
more results as the scrollbar advances?

I came up with this technique just on my own, so I'm definitely willing
to hear if anyone else has a good solution.  But remember the result
rows
I'm dealing with are not able to be indexed in any way because the
weight
of each result is the sorting criterion and that has to be calculated
based
on the search query, i.e. I can't gain any real improvement by adding
'WHERE SUM(weight) <= target_weight'.

-- 
Brandon Reynolds                  Phone: (330) 644-3059
Systems Engineer                    Fax: (330) 644-8110
Commercial Timesharing Inc.      E-mail: bmr at comtime.com



More information about the FreeTDS mailing list