Home > Back-end >  Is there any equivalent to COST and VOLATILE in Oracle (migrating from postgres)
Is there any equivalent to COST and VOLATILE in Oracle (migrating from postgres)

Time:10-04

My question is pretty straightforward:

I'm migrating functions from PostgreSQL to Oracle, and we have some functions defined with

COST 100
VOLATILE 

Is there any way to do this on oracle or does Oracle manage it automatically?

COST n tells the optimizer that the cost of executing the function will be n (PostgreSQL has no idea how expensive a function is), and VOLATILE specifies that there are no guarantees that the function will return the same result for the same parameters, which is also used by the optimizer.

CodePudding user response:

Since both COST 100 and VOLATILE are the default values for user-defined functions, I suspect that you never consciously set them. I would simply omit both clauses when migrating to Oracle.

  • Related