Il 10/06/2013 04:19, Jeff Janes ha scritto:
On further thought, that is not strange at all.  You have two very
selective join conditions, and the planner assumes they are independent, so
that it can multiply the selectivities.  But in reality they are completely
(or almost completely) dependent.   If the planner knew about cross column
correlations, that might not even help as you can have complete statistical
dependence without having correlation.

It seems unlikely to me that the timestamp belongs in both tables, since
it's value seems to be completely dependent on the value of the UUID.


In any event, it is unlikely the planner would pick a different plan were
it to correctly understand the selectivities, so no harm is done.  Although
it is easy to imagine similar queries where that would not be the case.

Cheers,

Jeff


Thank you very much ;)

Enrico

--
That's one small step for man; one giant leap for mankind

Enrico Pirozzi
Tel.  +39 0861 1855771 - Mob.+39 328 4164437 - Fax  +39 0861 1850310
http://www.pgtraining.com  - i...@pgtraining.com
www.enricopirozzi.info - i...@enricopirozzi.info
Skype sscotty71 - Gtalk sscott...@gmail.com

Attachment: smime.p7s
Description: Firma crittografica S/MIME

Reply via email to