that's for planner to know. You can estimate cost in there, of that procedure. I usually use select * from something limit 1 times number of rows that procedure returns on average. But I am sure, some more smart people here would have different ways to set it.