Re: Paging and SQL queries

From: Aristedes Maniatis (ar..aniatis.org)
Date: Mon May 28 2007 - 06:50:40 EDT

  • Next message: Andrus Adamchik: "Re: Paging and SQL queries"

    On 28/05/2007, at 4:49 PM, Andrus Adamchik wrote:

    > No. "resolvesFirstPage" really a shorthand for "is it possible to
    > reliably resolve objects on the first page using the existing
    > algorithm".

    OK. I guess I would have named it isFirstPageResolvable() or
    canResolveFirstPage(). But from your description it appears that it
    isn't specific to the first page and that either it is resolvable for
    any page, or not. So does it mean canResolveData()? But I'm still
    working through the code to understand when prefetches are relevant.

    > Just to confirm, is this a JDBC test or a test using DB client
    > tools (on Derby this may be the same thing, still worth doing a
    > JDBC run with your own code, as there can be unrelated bottlenecks
    > in the tools). E.g. create two PreparedStatements, one with
    > "select *", another with "select id", and only read "id" column in
    > both resultsets. See how much faster the second case is.

    OK. I just tried it a different way and the results are the same. In
    this case I used the Derby ij tool to make a JDBC connection to a
    Derby server on localhost. That server has real data from one of our
    clients with 120,000 students.

    select * from student; -> 53 seconds
    select id from student; -> 4 seconds

    I performed several runs to try and exclude cache warming and the
    variance was less than 10%. The output was redirected to a file on
    disk. There are around 30 columns in the student table with a range
    of data types. The output file on disk with all the fields was 120Mb
    when finished.

    So even when we exclude any overhead of Cayenne, the database itself
    takes that much longer to simply read all that data off the disk and
    return it. To be honest, I'm a bit disappointed by even that 4
    seconds on a 2Gb G5 iMac since that will result in some serious UI
    lag by the time that makes it through Cayenne, to the client over a
    network (Jetty and Hessian) and then a jTable is drawn.

    Ari

    -------------------------->
    Aristedes Maniatis
    phone +61 2 9660 9700
    PGP fingerprint 08 57 20 4B 80 69 59 E2 A9 BF 2D 48 C2 20 0C C8





    This archive was generated by hypermail 2.0.0 : Mon May 28 2007 - 06:51:16 EDT