Hi Ashutosh, Thank you for the review.
> Thanks. This will do. Is there a way to force the larger partition to > be computed first? That way we definitely know that the last > computation was done when all the tuples in the tuplestore were in > memory. Not sure if there's any way to force it in the SQL standard. However in term of implementation, PostgreSQL sorts the function (generate_series) scan result using a sort key "a.n < 3", which results in rows being >= 2 first (as false == 0), then rows being < 3 (as true == 1). So unless PostgreSQL changes the way to sort boolean data type, I think the result should be stable. Best reagards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp