Sven’s Technik-Blog

Einiges über Oracle, Security, Linux, … und auch über mich

  • Categories

  • Archives

  • Tag Cloud

Functions

Posted by Sven Vetter on July 8th, 2007

Jonathan Lewis schreibt in seinem Artikel Functions über eine oft gestellte Frage:

The use of functions - a function with other selects (eg. calculate availability of a part) - is slowing down our system when we do a select over our product file.
Is there some kind of rule when functions should be used or when we should try to create a more complex - combined - SQL that does not use the function.
Can functions be used in the where clause without loosing a lot of speed?

Ein guter, empfehlenswerte Artikel.

Was ich aber noch erwähnen würde:
Wenn ich aus SQL eine PL/SQL-Function aufrufe, die wiederum ein SQL ausführt, wird jeweils ein Kontext-Switch zwischen SQL-Engine und PL/SQL-Engine und nochmals SQL-Engine durchgeführt. Dieser dauert nicht sehr lang, sagen wir mal eine Millisekunde. Aber wenn ich dies 1'000'000 mal mache, sind das schon 2'000'000 ms - als mehr als eine halbe Stunde...

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>