Question about SPI_prepare

From: "Tim Keitt" <tkeitt(at)keittlab(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Question about SPI_prepare
Date: 2008-11-11 17:33:41
Message-ID: 6262c54c0811110933p5ef498a1yd27b136575ad9bf4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I have an application where I am building a plan with SPI_plan and
then this plan is called multiple times. There is one free parameter
($1) to the plan. The issue is with the order of the values returned.
If $1 is identical during successive calls to SPI_execute_plan, is
there any guarantee that the rows will be returned in the same order?
I know that repeated queries can return rows in different order, but
am specifically wondering about a prepared plan. (I can imagine the
plan somehow snap-shots the table when prepared such that rows always
come back in the same order, but I'm guessing that is not the case.)
If not, I simply have to add an order by clause which will incur some
overhead.

THK

--
Timothy H. Keitt
http://www.keittlab.org/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2008-11-11 17:54:44 Re: auto_explain contrib moudle
Previous Message Magnus Hagander 2008-11-11 17:17:08 Re: failed test float8 on mingw