[OS-JIRA] Created: (CAY-190) Add LIMIT statement to SQL query

From: jir..bjectstyle.org
Date: Thu Sep 02 2004 - 04:34:49 EDT

  • Next message: jir..bjectstyle.org: "[OS-JIRA] Created: (CAY-191) Datatypes of 'Source' and 'Target' of joins should match"

    Message:

      A new issue has been created in JIRA.

    ---------------------------------------------------------------------
    View the issue:

      http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-190

    Here is an overview of the issue:
    ---------------------------------------------------------------------
            Key: CAY-190
        Summary: Add LIMIT statement to SQL query
           Type: New Feature

         Status: Assigned
       Priority: Major

        Project: Cayenne
     Components:
                 Cayenne Core Library

       Assignee: Andrus Adamchik
       Reporter: Twan Kogels

        Created: Thu, 2 Sep 2004 4:34 AM
        Updated: Thu, 2 Sep 2004 4:34 AM

    Description:
    The possibility to add a LIMIT statement to the sql query which cayenne creates. Sometimes resultset are very large and there is no standard way in cayenne to limit the size of the resultset. SQL queries sometimes take more time to execute then queries with a LIMIT statement.

    From email:
    http://objectstyle.org/cayenne/lists/cayenne-user/2004/09/0000.html

    =================================
    Is it possible to add a "LIMIT" statement to the end of a query which SelectQuery executes? (like: select * from users where age < 25 LIMIT 50 )

    I'm currently testing my application and have a table with 20.000 records. I'm doing a query on this table and i sometimes get over 10.000 records. That's a bit too large. So i tryed setFetchLimit(50), but after reading the documentation setFetchLimit doesn't limit the size of the resultset, it only limits how many rows in the resultset cayenne will convert. This means i'm still stuck with a resultset of 10.000 rows and cayenne is only reading 50 of them :-)

    The difference between a query which results in a resultset of 10.000 or a query which results in a resultset of 50 is about 2,5 seconds.
    =================================

    ---------------------------------------------------------------------
    JIRA INFORMATION:
    This message is automatically generated by JIRA.

    If you think it was sent incorrectly contact one of the administrators:
       http://objectstyle.org/jira/secure/Administrators.jspa

    If you want more information on JIRA, or have a bug to report see:
       http://www.atlassian.com/software/jira



    This archive was generated by hypermail 2.0.0 : Thu Sep 02 2004 - 04:34:54 EDT