Vincenzo Romano wrote:
Hi all. In PG 8.2.4 I have a 4+M rows table like this:
I'd need to write a stored function that should do the following: for rec in select * from t order by f2,f2 loop ... end loop;
-> Seq Scan on t (cost=0.00..85501.38 rows=4779338 width=28)I'd like to know a hint about a technicque to avoid the sequential scan!
But you're fetching all the rows - what other way would be faster? -- Richard Huxton Archonet Ltd