Subject Re: stored procedures
Author kaczy27
--- In firebird-support@yahoogroups.com, "Ann W. Harrison"
<aharrison@i...> wrote:
> At 07:16 AM 9/8/2004, kaczy27 wrote:
>
> >I have stored procedure that calls another stored procedure,
> >while performing query to avoid multiple joining
>
> Why?
old pascal habits, I usually write a separate function if I have to
use the same complex code more than once.

In this case I need to combine the view from this one table (some
complex selectivity here) with results of few other stored
procedures querying to related tables (complex and differenet
selectivity as well).

>
> >I can rewrite the stored procedure to use single select that will
> >have three streamed joins will it be faster?
>
> Probably.
when (beside writing the query badly) can it be slower?
>
>
> >secondary
> >the sp provide a subset depending on the parameter
> >will it be faster executing if I create a view that will cover all
> >records and 'where' it? The result is used in subsequent queries
> >like above.
>
> Probably not.
Can you elaborate? Stored procedure does besicly the same. queries
the full tables, joins them with where clause and does
for.select.into.suspend

are SP a generally faster mechanism than views?
I believe I've seen a post of Helen, something like: use views
instead of sp for this kind of jobs (well she put it like use
screwdriver, not can-opener). This is of course out of context, and
I could misunderstood, but I am confused and hence I am asking.

thx a lot

>
> Regards,
>
>
> Ann
CUIN Kaczy