Suppose I have a not trivial query to return a list of places from a given name piece e.g. "Rio" would return both "Rio de Janeiro" and "Rio Negro". But in one place I would need a short version like "Rio Negro/BR" while in other I would have "Rio Negro (Gazetteer, Amazonas, Brasil)".
What is the optimal solution in PostgreSQL: create two smaller functions or one bigger?
The bigger function would be called from two different sources, each time running one of two similar SQL requests, both large.
Maybe if I split it in two different functions it will become faster?