X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 05E8F9FB265 for ; Mon, 10 Jul 2006 06:07:02 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 06730-10 for ; Mon, 10 Jul 2006 06:06:58 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by postgresql.org (Postfix) with ESMTP id DD7BE9FB256 for ; Mon, 10 Jul 2006 06:06:58 -0300 (ADT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Fzriq-0008Ig-Gf for pgsql-jdbc@postgresql.org; Mon, 10 Jul 2006 11:06:32 +0200 Received: from 83.145.96.118 ([83.145.96.118]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Jul 2006 11:06:32 +0200 Received: from Marc.Herbert by 83.145.96.118 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 10 Jul 2006 11:06:32 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-jdbc@postgresql.org From: Marc Herbert Subject: Re: Limit vs setMaxRows issue Date: Mon, 10 Jul 2006 11:06:15 +0200 Lines: 20 Message-ID: References: <44990D57.9070506@sebster.com> <4499CDB3.7040007@opencloud.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 83.145.96.118 User-Agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4 (Jumbo Shrimp, linux) Cancel-Lock: sha1:+RxoE+UmlfpEXCCEktxsvmHDIAo= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/23 X-Sequence-Number: 15449 Oliver Jowett writes: > It's not a bug. setMaxRows() is essentially a hint, there's certainly > no requirement that the driver will go off and add LIMIT clauses to > your query, My reading of the JDBC javadoc and my excessive "pickiness" do not agree with the word "hint" /** * Sets the limit for the maximum number of rows that any * ResultSet object can contain to the given number. * If the limit is exceeded, the excess * rows are silently dropped. OK nothing ever tells you that the server has to behave optimally and never compute anything useless. However in this case you know _for sure_ that additional rows will be useless.