Subject | Re: stored procedures |
---|---|
Author | kaczy27 |
Post date | 2004-09-09T08:06:35Z |
--- In firebird-support@yahoogroups.com, "Ann W. Harrison"
<aharrison@i...> wrote:
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).
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
<aharrison@i...> wrote:
> At 07:16 AM 9/8/2004, kaczy27 wrote:old pascal habits, I usually write a separate function if I have to
>
> >I have stored procedure that calls another stored procedure,
> >while performing query to avoid multiple joining
>
> Why?
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).
>when (beside writing the query badly) can it be slower?
> >I can rewrite the stored procedure to use single select that will
> >have three streamed joins will it be faster?
>
> Probably.
>Can you elaborate? Stored procedure does besicly the same. queries
>
> >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.
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
>CUIN Kaczy
> Regards,
>
>
> Ann