Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 5646563278D for ; Sun, 13 Jun 2010 07:45:40 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 31213-01 for ; Sun, 13 Jun 2010 10:45:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-vw0-f46.google.com (mail-vw0-f46.google.com [209.85.212.46]) by mail.postgresql.org (Postfix) with ESMTP id 022296323FC for ; Sun, 13 Jun 2010 07:45:32 -0300 (ADT) Received: by vws18 with SMTP id 18so337001vws.19 for ; Sun, 13 Jun 2010 03:45:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=HFIGJW/6ZnkRRohIbL16kVDJmVi3ZWDfRcTYCzBzwj8=; b=SsIXyYoLsin7T5KTw74gLj6CjnbLTrqiOxjObfzOopEgLIKSlIYCsKYVoqANahZXRY DdoJnQG0iHlasEYbV/D4emSaoV976JBcr/LBWY/HJH1Jf7p0xUXW/kuaQhHUJ5hv7Ogd XqLOQWo1bAu/eC0iHZ+qB3YTfbLafUZDAzsXs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=bY+bASWpu7vR3jkM+7WHRWLlbL6qp2eLxOXtmtL2vlMGOlRQZNeKpTrkHU0v7oEQq+ XQGgI424tCc58BRbVzOb5SQMkdZ2lzOACLOUC7iVlrdCns9hOhJrZTkKyCWJW6NlEBtY 88ft1aAsEJbSbKuF4kElRP7LUYvTFzWQ/azkY= MIME-Version: 1.0 Received: by 10.224.79.77 with SMTP id o13mr1300753qak.173.1276425931376; Sun, 13 Jun 2010 03:45:31 -0700 (PDT) Received: by 10.229.81.73 with HTTP; Sun, 13 Jun 2010 03:45:31 -0700 (PDT) In-Reply-To: References: <4C109406020000250003212E@gw.wicourts.gov> Date: Sun, 13 Jun 2010 16:45:31 +0600 Message-ID: Subject: Re: query hangs From: AI Rumman To: Amit Khandekar Cc: Kevin Grittner , mabewlun@gmail.com, pgsql-performance@postgresql.org Content-Type: multipart/alternative; boundary=00c09f8999bb38cb1f0488e71280 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001 X-Spam-Level: X-Archive-Number: 201006/228 X-Sequence-Number: 39084 --00c09f8999bb38cb1f0488e71280 Content-Type: text/plain; charset=ISO-8859-1 Any more idea, please. Is table partition a good solution for query optimization? On Fri, Jun 11, 2010 at 11:09 AM, Amit Khandekar < amit.khandekar@enterprisedb.com> wrote: > > > On 10 June 2010 18:47, AI Rumman wrote: > >> I am using Postgresql 8.1 and did not find FETCH_COUNT >> >> > Oh ok. Looks like FETCH_COUNT was introduced in 8.2 > > >> On Thu, Jun 10, 2010 at 6:55 PM, Amit Khandekar < >> amit.khandekar@enterprisedb.com> wrote: >> >>> >>> >>> On 10 June 2010 18:05, AI Rumman wrote: >>> >>>> Could you please give me the link for cursor- How to use it? >>>> >>>> >>>> On Thu, Jun 10, 2010 at 6:28 PM, Kevin Grittner < >>>> Kevin.Grittner@wicourts.gov> wrote: >>>> >>>>> AI Rumman wrote: >>>>> >>>>> >> Merge Left Join (cost=9500.30..101672.51 rows=2629549 width=506) >>>>> >>>>> > And the query does not return data though I have been waiting for >>>>> > 10 mins. >>>>> > >>>>> > Do you have any idea ? >>>>> >>>>> Unless you use a cursor, PostgreSQL interfaces typically don't show >>>>> any response on the client side until all rows have been received and >>>>> cached on the client side. That's estimated to be over 2.6 million >>>>> rows in this case. That can take a while. >>>>> >>>>> You might want to use a cursor.... >>>>> >>>>> >>> >>> If you are using psql client, using FETCH_COUNT to a small value will >>> allow you to achieve cursor behaviour. psql starts returning batches of >>> FETCH_COUNT number of rows . >>> >>> E.g. \set FETCH_COUNT 1 >>> will start fetching and displaying each row one by one. >>> >>> >>> >>> >>> -Kevin >>>>> >>>> >>>> >>> >> > --00c09f8999bb38cb1f0488e71280 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Any more idea, please.
Is table partition a good solution for query opti= mization?

On Fri, Jun 11, 2010 at 11:09 A= M, Amit Khandekar <amit.khandekar@enterprisedb.com> wrote:


On 10 June 2010 18:47, AI Rumman <ru= mmandba@gmail.com> wrote:
I am using Postgresql 8.1 and did not find FETCH_COUNT
=

Oh ok. Looks like FETCH_COUNT w= as introduced in 8.2


On Thu, Jun 10, 2010 at 6:55 PM, A= mit Khandekar <amit.khandekar@enterprisedb.com> wrote:


On 10 June 2010 18:05, AI Rumman <rummandba@gmail.com> wrote:
Could you please give me the link for cursor- How to use it?


On Thu, Jun 10, 2010 at 6:28 PM, K= evin Grittner <Kevin.Grittner@wicourts.gov> wrote:=
AI Rumman = =A0wrote:

>> Merge Left Join (cost=3D9500.30..101672.51 rows=3D2629549 width=3D= 506)

> And the query does not return data though I have been waiti= ng for
> 10 mins.
>
> Do you have any idea ?

Unless you use a cursor, PostgreSQL interfaces typically don't sh= ow
any response on the client side until all rows have been received and
cached on the client side. =A0That's estimated to be over 2.6 million rows in this case. =A0That can take a while.

You might want to use a cursor....



If you are using psql client, using FETCH_COUN= T to a small value will allow you to achieve cursor behaviour. psql starts = returning batches of FETCH_COUNT number of rows .

E.g. \set FETCH_COUNT 1
will start fetching and display= ing each row one by one.




-Kevin





--00c09f8999bb38cb1f0488e71280--