Re: Counting records in a PL/pgsql cursor

From: "redhog" <redhog(at)redhog(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Counting records in a PL/pgsql cursor
Date: 2006-11-03 14:39:29
Message-ID: 1162564769.921615.22450@e3g2000cwe.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Nope, the query is way too expensive to run it twice. (GIN scan over
> well over half a million rows. It's faster to do the
> get-as-cursor-then-loop-and-increment, I've measured that)

Can't you select into a temporary table and then do select count(*)
over that table, aswell as run your cursor over that temporary table?
Or is that way to space expensive?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Magnus Hagander 2006-11-03 14:43:06 Re: Counting records in a PL/pgsql cursor
Previous Message Luca Ferrari 2006-11-03 14:36:04 problem accessing a database