On Feb 8, 2006, at 7:05 AM, Damir Bijuklic wrote:
> Hi.
>
> I had a quick look at paging implementation in cayenne. If i
> understand it correctly it uses IncrementalFaultList to load object
> in such way thet it only loads ObjectId-s for the whole list, and
> uses them to load whole records when needed.
> I'm not sure this is happening because log indicates all columns
> are selected.
Correct - SELECT statement has all columns, but beyond the first page
only the id columns are read back. This gives a huge performance
increase in many cases, but of course there is room for improvement.
> Many databases implement ways to limit portion of the dataset
> directly in select query statement, in different ways (by using top
> keyword and where, or first and skip statements or whatever)
>
> I would like to only get portion of records directly for select.
> Could this be implemented in another IncrementalFaultList that
> would use select translators for specific databases that support
> this functionality?
> What else would be needed to support this?
>
> As Chris would say (I think), am i smoking crack?
We wanted IncrementalFaultList to work consistently, i.e. if db data
changes between the two queries, the results are unpredictable. But
for some specific cases (e.g. if you know upfront that the data is
unchanged), you may create your own version of IncrementalFaultList
that does what you describe.
Note that in 1.2 it is possible to subclass Queries and customize
their execution via Query.createSQLAction(..). This is where you can
stick your custom SQL generation.
Andrus
This archive was generated by hypermail 2.0.0 : Wed Feb 08 2006 - 16:59:17 EST