Friday, March 9, 2012

Performance

Is there any difference between:
executing 2 queries in the same database at the same time
or
Executing 2 queries in 2 different databases at the same time
The same conditions for the 2 databases (same query, tables, indexes).
The concrete question is: is there any performance advantages in spliting
one database into 2.
--
Thanks
Regards.
JosemaYes there's a difference but there are a lot of variables to consider and
the answer is almost never simple. As a start on some of the things to
consider:
Advantages of separate databases:
Different lock spaces so no contention as long as the query stays within
a database
If the different databases are on different drives there may be some IO
advantages
Different logs so possibility for parallelism in log writes
Disadvantages of separate databases:
Any queries that span the databases are distributed queries and there
are significant performance penalties for distributed queries.
Each database requires a certain amount of memory for meta-data, query
execution space, etc. so two databases will require more memory than the
same data in a single database.
If the data isn't completely disjoint - there is common data that both
databases need, the data must be replicated or distributed queries are
required to obtain it - both of which hurt performance.
Generally there is more work required to maintain multiple databases.
So the answer is that splitting the data into two databases will make some
thing faster and some thing slower so the net change depends on how
independent the data is and what kind of queries your application does.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"Josema" <Jestrade@.ocu.org> wrote in message
news:3CE8F364-6DE6-4BB1-8741-2660D62CB714@.microsoft.com...
> Is there any difference between:
> executing 2 queries in the same database at the same time
> or
> Executing 2 queries in 2 different databases at the same time
> The same conditions for the 2 databases (same query, tables, indexes).
> The concrete question is: is there any performance advantages in spliting
> one database into 2.
> --
> Thanks
> Regards.
> Josema

No comments:

Post a Comment