On Tue, 18 Dec 2018 at 09:21, Kumar, Virendra <Virendra.Kumar@xxxxxxxxxxx> wrote: > I tried query with function dependency statistics but it did not help. I don't see we can create such statistics on table join. There's mention of why this is the case in the docs in [1]: "14.2.2.1.1. Limitations of Functional Dependencies Functional dependencies are currently only applied when considering simple equality conditions that compare columns to constant values. They are not used to improve estimates for equality conditions comparing two columns or comparing a column to an expression, nor for range clauses, LIKE or any other type of condition." [1] https://www.postgresql.org/docs/10/planner-stats.html -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services