> >> The best solution is probably to put a LIMIT into the DECLARE CURSOR, > >> so that the planner can see how much you intend to fetch. > I assume that this limits the resultset to a LIMIT. That is not what I was > hoping for. I was hoping for a way to scrolll throught the whole tables > with orders. > > I have tested, and if one really wants the whole table the query with "set > enable_seqscan = on" lasts 137 secs, the query with "set enable_seqscan = > off" lasts 473 secs, so (alas), the planner is right. > > I sure would like to have ISAM like behaviour once in a while.
Then stop using cursors. A few months back I detailed the relative merits of using Cursors v. Queries to provide ISAM like functionality and Queries win hands down. Right now I am using pg as an ISAM backend for a relatively old and large COBOL ERP via a C++ ISAM driver, for which a publicly available version of the source will be available Real Soon Now :-). Merlin ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly