I used one function as left join in Query in postgresql After adding making join with Function, Query is taking too much time. The tables are huge and numbers of rows are also m