By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,401 Members | 1,367 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,401 IT Pros & Developers. It's quick & easy.

Optimizing SQL: bind variables, prepared stms, histograms

P: n/a
A few question regarding PostgreSQL handling of queries:

- Is each query submitted parsed and planned even if it is identical to a
query submitted before?
For example, 10 queries "select * from animals where id=:b1" with possibly
different bind variable :b1 values will be fully processed (parsed and
planned) 10 times?

- does it make difference for postgreSQL performance if bind variables are
used or not?
Does it make difference in performance if the same prepared statement is used
just with different values of bind variables?

- Does postgreSQL optimizer account for statistics like histograms when bind
variables are used (i.e. try to built a new plan given a concrete value of
bind variable)?

Thank you in advance,

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 22 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.