Rob,

I'd estimate the priority of this feature as very low. There are some
reasons why this is less important for Virtuoso than for Oracle:

1. Virtuoso integrates web server and the core of RDBMS in a single
process, so page generation can be made by a Virtuoso/PL stored
procedure from beginning to end. Hence the total size of result set in
bytes is not as important as in inter-process communication case.

2. If data should be returned to the client then either a procedure view
or user-defined aggregate can incapsulate any appropriate logic,
including logic of "TOP m,n". It is not a problem for a procedure view
to return, say, all even-numbered rows or rows #10-#19, plus a total
count. It is not a problem for user-define aggregate to return a single
value that is a vector of required rows in a single column, so the
result-set

select my_funny_aggregate (fields, filtering_arguments), count (*)
from ...

will return a single row with all required data.

3. Virtuoso hackers may cheat and tweak parameters of opened cursors
between fetches. Consider a Virtuoso/PL procedure, a local variable
start_key and an opened cursor for SELECT such that WHERE clause
contains condition like (primary_key_column > start_value) . It is safe
to open cursor and make few fetches with one value of start_key, then
decide that some rows may be skipped and increase the value of start_key
so next fetches will probably ignore rows with keys less than new value
of start_key.

The most popular use case of this ugly dirty hack is an "intersection
join" at application level. Some brain-damaging examples can be found in
procedures "CatFilter_GET_RDF_INVERSE_HITS_DISTVALS" and
"CatFilter_GET_RDF_INVERSE_HITS_RES_IDS" in binsrc/dav/DET_Catfilter.sql
(the growing value of res_id_max variable is used as a parameter of
numerous opened cursors).

Don't use this hack; or at least don't use it without a reason :)

Best Regards,

Ivan Mikhailov,
OpenLink Software.

On Thu, 2008-05-01 at 15:17 -0700, rob bygrave wrote:
> Does Virtuoso use an MVCC architecture?
> 
> I wondering if it has support (or planned support) for something like
> Oracle Flash back queries.
> 
> Ala   ... select ... from ... AS OF SCN xxx
> 
> http://www.singlequery.com/?cat=10
> ... is an interesting example of a use of flash back queries.
> 
> Thanks, Rob.




Reply via email to