You are here: Re: SELECT * vs SELECT col1, col2 « MsSQL Server « IT news, forums, messages
Re: SELECT * vs SELECT col1, col2

Posted by Erland Sommarskog on 09/20/07 21:10

Serge Rielau (srielau@ca.ibm.com) 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@sommarskog.se

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация