Re: What is the fastest way to get a resultset

From: Jeff <threshar(at)torgo(dot)978(dot)org>
To: Bupp Phillips <hello(at)noname(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: What is the fastest way to get a resultset
Date: 2003-08-25 20:46:34
Message-ID: Pine.BSF.4.44.0308251645360.15800-100000@torgo.978.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, 25 Aug 2003, Bupp Phillips wrote:

>
> I have a table that has 103,000 records in it (record size is about 953
> bytes) and when I do a select all (select * from <table>) it takes a
> whopping 30 secs for the data to return!!
>
> SQLServer on the other hand takes 6 secs, but you can also use what is
> called a firehose cursor, which will return the data in < 1 sec.
>
You probably want a cursor.
Typically what happens is postgres sends _all_ the data to the client -
which can be rather substantial. A cursor allows you to say "get me the
first 1000 records. now the next 1000" - it should get you the speed you
want.

--
Jeff Trout <jeff(at)jefftrout(dot)com>
http://www.jefftrout.com/
http://www.stuarthamm.net/

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2003-08-25 21:09:19 Re: Replication Ideas
Previous Message Magnus Naeslund(f) 2003-08-25 20:37:24 Re: What is the fastest way to get a resultset