Wednesday, March 21, 2012

insert to view vs. insert directly to table

Will I see performance degrading if I use commands to insert / delete and
select from a view as supposed to doing it directly from a table
The view is a simple select * from TableNameINdirected one level as you have, no.
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Avi" <rememberoti@.yahoo.com> wrote in message
news:uHkW5FOlEHA.3520@.tk2msftngp13.phx.gbl...
> Will I see performance degrading if I use commands to insert / delete and
> select from a view as supposed to doing it directly from a table
>
> The view is a simple select * from TableName
>
>|||Avi,
Firstly, your view should not be select * from table, it should be
select <columnlist> from table.
You can only insert into a view if the view only references a base
table. Why have you got a view that does a select * anyway? Why not just
insert into the table?
You could try benchmarking this yourself to see if there's any
difference, should be pretty easy to set up. I don't think you'll notice
much of a difference, though the direct insert into the table probably
will win it by nanoseconds.
--
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
Avi wrote:
> Will I see performance degrading if I use commands to insert / delete and
> select from a view as supposed to doing it directly from a table
>
> The view is a simple select * from TableName
>
>

No comments:

Post a Comment