Re: Plan rows - 1 or many

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Peter Mogensen *EXTERN*" <apm(at)one(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Plan rows - 1 or many
Date: 2014-03-12 08:28:00
Message-ID: A737B7A37273E048B164557ADEF4A58B17CE3D6B@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Peter Mogensen wrote:
> I have an application where I would really like to be able to look at en
> SQL query and answer the question:
>
> "Is this query capable of returning more than 1 row?"

> Can I conclude that when plan_rows is 1 then there will never be more
> than 1 row returned by the query?

I would say no.

If the planner estimates one row, that means that it guesses that
it will be one or less.

And a query that can potentially return many rows can certainly
also return only one row or none at all.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Mogensen 2014-03-12 08:53:52 Re: Plan rows - 1 or many
Previous Message Peter Mogensen 2014-03-12 08:12:13 Plan rows - 1 or many