Search Postgresql Archives

Re: Query optimizer & prepared statements

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jack Orenstein wrote:
If x is an integer column with an index, then

    select ...
    from T
    where x > 1

and

    select ...
    from T
    where x > 1000000000

could be optimized differently. So how is optimization done for a prepared statement containing a variable, e.g.

    select ...
    from T
    where x > $1

http://www.postgresql.org/docs/current/static/sql-prepare.html#AEN58703 explains this.

If your parameter is a unique key, then you won't see any difference. If your parameter is a non-unique key, there may be differences depending on your data/distribution etc.

--
Postgresql & php tutorials
http://www.designmagick.com/


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux