Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 59045 invoked from network); 30 Jun 2008 08:55:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Jun 2008 08:55:34 -0000 Received: (qmail 85505 invoked by uid 500); 30 Jun 2008 08:55:34 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 85496 invoked by uid 500); 30 Jun 2008 08:55:34 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 85485 invoked by uid 500); 30 Jun 2008 08:55:34 -0000 Delivered-To: apmail-incubator-cayenne-user@incubator.apache.org Received: (qmail 85482 invoked by uid 99); 30 Jun 2008 08:55:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jun 2008 01:55:34 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of oyvindharboe@gmail.com designates 209.85.132.250 as permitted sender) Received: from [209.85.132.250] (HELO an-out-0708.google.com) (209.85.132.250) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jun 2008 08:54:43 +0000 Received: by an-out-0708.google.com with SMTP id b38so226279ana.83 for ; Mon, 30 Jun 2008 01:55:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:mime-version:content-type:content-transfer-encoding :content-disposition:x-google-sender-auth; bh=hMSqPB3By6tnzViGOrGE1/We+JUV/2IjSx0gscc+dP4=; b=VxJ8Nko6FWcBkoIOfzMloTN3dLQm0XouX5S+DV9Q3psXXY5jpHePA0rpidAkBfQRTA 6LmSQBKMrz5ViFHfrpKDclYHDNNeCKo7gBINmyI8hna4exXiJ2/9QOa8NA8IecovrKqT lli1EjSgjgLWpDbVsGgM9BtNBzTqdPV5QmM2A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition:x-google-sender-auth; b=gWd4HFPP9AKuo8llkWFjNB5Pu+Z2i0OBL9JpsToYYaAZx1BhW1yFcsSpknj7J3I4UT +9XlQo3Xx9kNZ7te6YnKrI7OnKGGXuWcAehoA9OP7FgKQv+N/BfddKa6LnwCqnK7a3f2 ZgiHHzXMq20s5nuXyDEGxlpaKuXt2pyza/eDk= Received: by 10.101.69.10 with SMTP id w10mr3592541ank.30.1214816099066; Mon, 30 Jun 2008 01:54:59 -0700 (PDT) Received: by 10.100.7.20 with HTTP; Mon, 30 Jun 2008 01:54:59 -0700 (PDT) Message-ID: Date: Mon, 30 Jun 2008 10:54:59 +0200 From: "=?ISO-8859-1?Q?=D8yvind_Harboe?=" Sender: oyvindharboe@gmail.com To: cayenne-user@incubator.apache.org Subject: Memory usage and select statements MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Google-Sender-Auth: 6efc40eed4414cc9 X-Virus-Checked: Checked by ClamAV on apache.org An SQL statement includes a list of which columns to fetch for the query. Consider a table "book" with three columns, id(pk), title(<100 chars) and content(the entire text of the book). SELECT id, title FROM book If one of the columns are big and rarely used, then it makes little sense to transfer it to the client from the database for every query. E.g. above the entire text of the book is left out. The difference in memory usage can be quite dramatic. Can I do the same w/Cayenne? Can I have the columns fetched on-demand? I'd like to avoid hardcoded SQL templates obviously. SelectTranslator.createSqlString() unconditionally adds all columns... --=20 =D8yvind Harboe http://www.zylin.com/zy1000.html ARM7 ARM9 XScale Cortex JTAG debugger and flash programmer