I ready somewhere that PostgreSQL is able to optimize SQL functions,
the same way it does with views. For example if you do:
select * from cv_customers() order by customer_id;
When customers is an SQL function the optimizer/planner will be able to
actually use the customer_id index.
>From some tests I made it doesn't seem true.. Yet I am asking to know
for sure.