Re: SELECT * vs SELECT col1, col2
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Thu, 20 Sep 2007 21:10:13 +0000 (UTC)
Serge Rielau (srielau@xxxxxxxxxx) writes:
Uhmm.. I don't think I'd want to confuse the official information schema
with what the DBMS uses for itself. You assume there is neither
compacting of the decomposed information into one object (like a LOB)
nor caching of the schema in memory.
I would guess that SQL Server caches system tables more or less like
either tables. That would at least make most sense to me. DB2 may be
different.
And caching or not, the metadata changes requires a lock. I did this in
one window:
begin transaction
alter table Orders add xyz int null
And in another window I tried to running SELECTs against the Orders table,
and it no difference if I had "SELECT *" or if I selected a small number
of columns. The query blocked.
Again, this may be different in DB2.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- References:
- Re: SELECT * vs SELECT col1, col2
- From: Serge Rielau
- Re: SELECT * vs SELECT col1, col2
- Prev by Date: Create Function permission...
- Next by Date: Re: How Do I give EXECUTE Permissions on Stored Procedures?
- Previous by thread: Re: SELECT * vs SELECT col1, col2
- Next by thread: How to select count records that "contain" data?
- Index(es):
Relevant Pages
|