Re: Whats the difference?

From: tim erickson <dockersblack_at_hotmail.com>
Date: 31 Aug 2002 15:16:17 -0700
Message-ID: <cfbf4f63.0208311416.71eab4f8_at_posting.google.com>


[Quoted] I have run a test ASP script connects to the server and switches between two databases. It makes 20 seconds difference in 10.000 repetitions.
Accessing to the objects using database name (database..table) is faster than
USE database
select from table
type queries.
Thanks for the response.

"Tibor Karaszi" <no_at_spam.com> wrote in message news:<5o0c9.5128$e5.825175_at_newsb.telia.net>...
> What context?
>
> I don't know if "USE" is a standard command, but in SQL Server (as you
> probably know), you switch database context with it. Besides making the code
> more readable and allow you to have, say, both a development database and a
> test database on same dbms instance (as you don't hard code database name in
> your code), it also improves performance to "be in" current database and not
> qualify object access with database name. Qualifying object access with
> object owner name improves performance, however (reduces risk for
> re-compilations).
>
> Above is based on MS SQL Server experience, I can't vouch for other DBMS's.
> Ansi terminology for "database" is "catalog" and for "object owner" is
> "schema", btw.
> --
> Tibor Karaszi
>
>
> "tim erickson" <dockersblack_at_hotmail.com> wrote in message [Quoted]
> news:cfbf4f63.0208301454.9371918_at_posting.google.com...
> > Whats the difference between these two statements?
> > 1.
> > "Use foo
> > select * from bar"
> >
> > 2."select * from foo..bar"
Received on Sun Sep 01 2002 - 00:16:17 CEST

Original text of this message