Re: Counting records in a PL/pgsql cursor - Mailing list pgsql-general

From redhog
Subject Re: Counting records in a PL/pgsql cursor
Date
Msg-id 1162564769.921615.22450@e3g2000cwe.googlegroups.com
Whole thread Raw
In response to Re: Counting records in a PL/pgsql cursor  ("Magnus Hagander" <mha@sollentuna.net>)
Responses Re: Counting records in a PL/pgsql cursor  ("Magnus Hagander" <mha@sollentuna.net>)
List 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?


pgsql-general by date:

Previous
From: Luca Ferrari
Date:
Subject: problem accessing a database
Next
From: "Magnus Hagander"
Date:
Subject: Re: Counting records in a PL/pgsql cursor