Subject | Re: [firebird-support] hiding some records |
---|---|
Author | Z T Minhas |
Post date | 2008-07-29T13:01:04Z |
martijn i really appreciate you telling me this because i myself have been experimenting with FB but i was wondering about the performance between view and SP. do you think it would be better then to rather than have a select query in the SP to make a seperate view (with proper filtration), and then call it from the SP or simply to call the view as required by an application.
----- Original Message ----
From: Martijn Tonies <m.tonies@...>
To: firebird-support@yahoogroups.com
Sent: Tuesday, July 29, 2008 3:28:35 PM
Subject: Re: [firebird-support] hiding some records
the same function, and choose from the stored procedure. otherwise.... just
be careful! :-)
with the view, for example, the query plan can be adjusted and
the view select expression will more-or-less be used "in line".
With a Stored Procedure, this will never happen! What does
this mean? Well, that a:
select * from my_selectable_procedure where id = 1
will read ALL ROWS in the table and only filters afterwards.
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !
Also search the knowledgebases at http://www.ibphoenix.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links
[Non-text portions of this message have been removed]
----- Original Message ----
From: Martijn Tonies <m.tonies@...>
To: firebird-support@yahoogroups.com
Sent: Tuesday, July 29, 2008 3:28:35 PM
Subject: Re: [firebird-support] hiding some records
> at the database level make a view which has the clause "where active='Y'"and choose the view. or alternatively make a stored procedure which serves
the same function, and choose from the stored procedure. otherwise.... just
be careful! :-)
>Mind you, with a VIEW, if you use the view in a query that joins
with the view, for example, the query plan can be adjusted and
the view select expression will more-or-less be used "in line".
With a Stored Procedure, this will never happen! What does
this mean? Well, that a:
select * from my_selectable_procedure where id = 1
will read ALL ROWS in the table and only filters afterwards.
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com
------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://www.firebirdsql.org and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !
Also search the knowledgebases at http://www.ibphoenix.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links
[Non-text portions of this message have been removed]