Showing posts with label clustered. Show all posts
Showing posts with label clustered. Show all posts

Friday, March 30, 2012

performance hit after installing Oracle client?

SQL Server 2000 Enterprise Edition clustered on Win 2k Advanced Server
Last week we installed the Oracle client 8.1.6 to allow DTS to extract data
from our Oracle Financials system, which has been working fine. Since then u
sers have reported poor performance. Performance monitor showed low (20-30%)
CPU usage, 99.9% buffer ca
che hit ratio, usual disk utilisation amounts, but Pages/sec was averaging a
round 300. I understand this should be under 20. There is nothing else runni
ng on this server. We took the server down and switched to another node whic
h did not have the Oracle c
lient loaded and performance is back to usual. Has anyone else had a similar
problem, or is the Oracle software just a red herring?
Scott Doughtykevmc@.online.microsoft.com (Kevin McDonnell [MSFT]) wrote in message news:<ByFbcLS4DHA.568@.cpmsftngxa07.
phx.gbl>...
quote:

> When the performance was poor did you have multiple instances of SQL
> running on the same node?
> Did the performance improve after moving a single instance of SQL to
> another node?
> Thanks,
> Kevin McDonnell
> Microsoft Corporation
> This posting is provided AS IS with no warranties, and confers no rights.

Hi Kevin
We only had one instance running. We switched to another node which
didn't have the Oracle client installed and all was fine. As I say,
the oracle software may not be relevant. If it helps, while the paging
was running high, the amount of free RAM was over 200Mb.
Scottsql

Wednesday, March 28, 2012

Performance gain

How much of a performance gain I can get on 1.2 million rows insert via DTS
package If I,
- Drop 1 clustered and 2 non-clustered index on the table I am loading
- 2-3 foreign keys referencing other tables
- Replace the delete table with truncate table
- Do a bulk insert
- Re-create the indexes
- Re-create the foreign keys
Thanks for any input.
"DXC" <DXC@.discussions.microsoft.com> wrote in message
news:72D6D8E4-6F94-4DB9-A93E-F67F07F3D277@.microsoft.com...
> How much of a performance gain I can get on 1.2 million rows insert via
> DTS
> package If I,
>
Well best way will be to try it. ;-)
BUT, in my experience what you're doing will help.

> - Drop 1 clustered and 2 non-clustered index on the table I am loading
This helps, but mostly if the imported data is already sorted on the
clustered index. Otherwise, rebuilding the clustered index may eat up any
savings.

> - 2-3 foreign keys referencing other tables
> - Replace the delete table with truncate table
HUGE help

> - Do a bulk insert
Definitely faster w/o indices.

> - Re-create the indexes
> - Re-create the foreign keys
>
In general you should see a big improvement, especially if the clustered
index doesn't have to do much data movement.

> Thanks for any input.
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html
|||You have given us too little data to assist you properly. The biggest thing
missing is how many rows are ALREADY in the table and how many rows are in
the referencing tables?
In general if you are inserting an amount that is a reasonably large
fraction of the total rows already in the table, then it is better to
drop/rebuild. But in this case if your table already has a billion rows,
adding 1.2 million would be much faster keeping things as they are.
TheSQLGuru
President
Indicium Resources, Inc.
"DXC" <DXC@.discussions.microsoft.com> wrote in message
news:72D6D8E4-6F94-4DB9-A93E-F67F07F3D277@.microsoft.com...
> How much of a performance gain I can get on 1.2 million rows insert via
> DTS
> package If I,
> - Drop 1 clustered and 2 non-clustered index on the table I am loading
> - 2-3 foreign keys referencing other tables
> - Replace the delete table with truncate table
> - Do a bulk insert
> - Re-create the indexes
> - Re-create the foreign keys
> Thanks for any input.
|||On Thu, 10 May 2007 09:10:01 -0700, DXC
<DXC@.discussions.microsoft.com> wrote:

>How much of a performance gain I can get on 1.2 million rows insert via DTS
>package If I,
>- Drop 1 clustered and 2 non-clustered index on the table I am loading
>- 2-3 foreign keys referencing other tables
>- Replace the delete table with truncate table
>- Do a bulk insert
>- Re-create the indexes
>- Re-create the foreign keys
>Thanks for any input.
Besides two good answers already, how long does it take now?
J.

Performance gain

How much of a performance gain I can get on 1.2 million rows insert via DTS
package If I,
- Drop 1 clustered and 2 non-clustered index on the table I am loading
- 2-3 foreign keys referencing other tables
- Replace the delete table with truncate table
- Do a bulk insert
- Re-create the indexes
- Re-create the foreign keys
Thanks for any input."DXC" <DXC@.discussions.microsoft.com> wrote in message
news:72D6D8E4-6F94-4DB9-A93E-F67F07F3D277@.microsoft.com...
> How much of a performance gain I can get on 1.2 million rows insert via
> DTS
> package If I,
>
Well best way will be to try it. ;-)
BUT, in my experience what you're doing will help.

> - Drop 1 clustered and 2 non-clustered index on the table I am loading
This helps, but mostly if the imported data is already sorted on the
clustered index. Otherwise, rebuilding the clustered index may eat up any
savings.

> - 2-3 foreign keys referencing other tables
> - Replace the delete table with truncate table
HUGE help

> - Do a bulk insert
Definitely faster w/o indices.

> - Re-create the indexes
> - Re-create the foreign keys
>
In general you should see a big improvement, especially if the clustered
index doesn't have to do much data movement.

> Thanks for any input.
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html|||You have given us too little data to assist you properly. The biggest thing
missing is how many rows are ALREADY in the table and how many rows are in
the referencing tables'
In general if you are inserting an amount that is a reasonably large
fraction of the total rows already in the table, then it is better to
drop/rebuild. But in this case if your table already has a billion rows,
adding 1.2 million would be much faster keeping things as they are.
TheSQLGuru
President
Indicium Resources, Inc.
"DXC" <DXC@.discussions.microsoft.com> wrote in message
news:72D6D8E4-6F94-4DB9-A93E-F67F07F3D277@.microsoft.com...
> How much of a performance gain I can get on 1.2 million rows insert via
> DTS
> package If I,
> - Drop 1 clustered and 2 non-clustered index on the table I am loading
> - 2-3 foreign keys referencing other tables
> - Replace the delete table with truncate table
> - Do a bulk insert
> - Re-create the indexes
> - Re-create the foreign keys
> Thanks for any input.|||On Thu, 10 May 2007 09:10:01 -0700, DXC
<DXC@.discussions.microsoft.com> wrote:

>How much of a performance gain I can get on 1.2 million rows insert via DTS
>package If I,
>- Drop 1 clustered and 2 non-clustered index on the table I am loading
>- 2-3 foreign keys referencing other tables
>- Replace the delete table with truncate table
>- Do a bulk insert
>- Re-create the indexes
>- Re-create the foreign keys
>Thanks for any input.
Besides two good answers already, how long does it take now?
J.

Performance gain

How much of a performance gain I can get on 1.2 million rows insert via DTS
package If I,
- Drop 1 clustered and 2 non-clustered index on the table I am loading
- 2-3 foreign keys referencing other tables
- Replace the delete table with truncate table
- Do a bulk insert
- Re-create the indexes
- Re-create the foreign keys
Thanks for any input."DXC" <DXC@.discussions.microsoft.com> wrote in message
news:72D6D8E4-6F94-4DB9-A93E-F67F07F3D277@.microsoft.com...
> How much of a performance gain I can get on 1.2 million rows insert via
> DTS
> package If I,
>
Well best way will be to try it. ;-)
BUT, in my experience what you're doing will help.
> - Drop 1 clustered and 2 non-clustered index on the table I am loading
This helps, but mostly if the imported data is already sorted on the
clustered index. Otherwise, rebuilding the clustered index may eat up any
savings.
> - 2-3 foreign keys referencing other tables
> - Replace the delete table with truncate table
HUGE help
> - Do a bulk insert
Definitely faster w/o indices.
> - Re-create the indexes
> - Re-create the foreign keys
>
In general you should see a big improvement, especially if the clustered
index doesn't have to do much data movement.
> Thanks for any input.
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html|||You have given us too little data to assist you properly. The biggest thing
missing is how many rows are ALREADY in the table and how many rows are in
the referencing tables'
In general if you are inserting an amount that is a reasonably large
fraction of the total rows already in the table, then it is better to
drop/rebuild. But in this case if your table already has a billion rows,
adding 1.2 million would be much faster keeping things as they are.
--
TheSQLGuru
President
Indicium Resources, Inc.
"DXC" <DXC@.discussions.microsoft.com> wrote in message
news:72D6D8E4-6F94-4DB9-A93E-F67F07F3D277@.microsoft.com...
> How much of a performance gain I can get on 1.2 million rows insert via
> DTS
> package If I,
> - Drop 1 clustered and 2 non-clustered index on the table I am loading
> - 2-3 foreign keys referencing other tables
> - Replace the delete table with truncate table
> - Do a bulk insert
> - Re-create the indexes
> - Re-create the foreign keys
> Thanks for any input.|||On Thu, 10 May 2007 09:10:01 -0700, DXC
<DXC@.discussions.microsoft.com> wrote:
>How much of a performance gain I can get on 1.2 million rows insert via DTS
>package If I,
>- Drop 1 clustered and 2 non-clustered index on the table I am loading
>- 2-3 foreign keys referencing other tables
>- Replace the delete table with truncate table
>- Do a bulk insert
>- Re-create the indexes
>- Re-create the foreign keys
>Thanks for any input.
Besides two good answers already, how long does it take now?
J.

Monday, March 12, 2012

Performance : Queries taking very long time (Urgent)

The production_table has ~20 million records and has identity key which is
clustered and has non clustered index on Created_Date.
The following queries taking very long time as the plan using index scan.
Please advise for optimization.
select *
from production_table p -- production_table has ~10 million records
where datediff(dd, p.Created_Date, getdate()) = 7
select *
from production_table p -- -- production_table has ~10 million records
where datediff(mm, p.created_date, getdate()) = 1
Thanks in advance.
Hmm.. How many rows do the queries return ? Theres lots one could advice,
such as do you really need a select * or one could state, creating a
clustered index on Created_Date column or even trying to rewrite the where
clause something like
where created_date = getdate-7 and so on..
I think thats related to SARG and how the optimiser would pick the right
plan.. But with so many records, and with the select * in there, even if
does do an index seek , it would follow with a bookmark lookup to get the
rest of the data which could be expensive as well..
So without knowing a whole lot about ur application, it would be wrong for
me to really give the right solution...
Probably someone else can chime in with something better.
"DKRReddy" <dkrreddy@.hotmail.com> wrote in message
news:%23$XOvrMDFHA.392@.TK2MSFTNGP14.phx.gbl...
> The production_table has ~20 million records and has identity key which
is
> clustered and has non clustered index on Created_Date.
> The following queries taking very long time as the plan using index scan.
> Please advise for optimization.
> select *
> from production_table p -- production_table has ~10 million records
> where datediff(dd, p.Created_Date, getdate()) = 7
>
> select *
> from production_table p -- -- production_table has ~10 million
records
> where datediff(mm, p.created_date, getdate()) = 1
>
> Thanks in advance.
>
|||I would try running UPDATE STATISTICS initially, then try an index hint and
then consider clustering the date column rather than the identity column. You
could also test the use of calculated columns with indexes on the calculated
columns IE: day_number and month_number.
regards,
Mark Baekdal
http://www.dbghost.com
http://www.innovartis.co.uk
+44 (0)208 241 1762
Database change management for SQL Server
"DKRReddy" wrote:

> The production_table has ~20 million records and has identity key which is
> clustered and has non clustered index on Created_Date.
> The following queries taking very long time as the plan using index scan.
> Please advise for optimization.
> select *
> from production_table p -- production_table has ~10 million records
> where datediff(dd, p.Created_Date, getdate()) = 7
>
> select *
> from production_table p -- -- production_table has ~10 million records
> where datediff(mm, p.created_date, getdate()) = 1
>
> Thanks in advance.
>
>
|||Calculate the fixed date range before you query. Always list the
columns you require rather than use SELECT *.
SELECT col1, col2, ...
FROM production_table
WHERE created_date >= '20050131'
AND created_date < '20050201'
SELECT col1, col2, ...
FROM production_table
WHERE created_date >= '20050206'
AND created_date < '20050207'
David Portas
SQL Server MVP
|||David is correct,... when you use a function in a where clause, the
optimizer is unable to use index statistics to determine the best index.
Pre-determining the date ranges as David suggests will give the optimizer
visibility into the index statistics... Performance will then depend on the
number of rows that satisfy the where clause...
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
"DKRReddy" <dkrreddy@.hotmail.com> wrote in message
news:%23$XOvrMDFHA.392@.TK2MSFTNGP14.phx.gbl...
> The production_table has ~20 million records and has identity key which
> is
> clustered and has non clustered index on Created_Date.
> The following queries taking very long time as the plan using index scan.
> Please advise for optimization.
> select *
> from production_table p -- production_table has ~10 million records
> where datediff(dd, p.Created_Date, getdate()) = 7
>
> select *
> from production_table p -- -- production_table has ~10 million
> records
> where datediff(mm, p.created_date, getdate()) = 1
>
> Thanks in advance.
>

Performance : Queries taking very long time (Urgent)

The production_table has ~20 million records and has identity key which is
clustered and has non clustered index on Created_Date.
The following queries taking very long time as the plan using index scan.
Please advise for optimization.
select *
from production_table p -- production_table has ~10 million records
where datediff(dd, p.Created_Date, getdate()) = 7
select *
from production_table p -- -- production_table has ~10 million records
where datediff(mm, p.created_date, getdate()) = 1
Thanks in advance.Hmm.. How many rows do the queries return ? Theres lots one could advice,
such as do you really need a select * or one could state, creating a
clustered index on Created_Date column or even trying to rewrite the where
clause something like
where created_date = getdate-7 and so on..
I think thats related to SARG and how the optimiser would pick the right
plan.. But with so many records, and with the select * in there, even if
does do an index seek , it would follow with a bookmark lookup to get the
rest of the data which could be expensive as well..
So without knowing a whole lot about ur application, it would be wrong for
me to really give the right solution...
Probably someone else can chime in with something better.
"DKRReddy" <dkrreddy@.hotmail.com> wrote in message
news:%23$XOvrMDFHA.392@.TK2MSFTNGP14.phx.gbl...
> The production_table has ~20 million records and has identity key which
is
> clustered and has non clustered index on Created_Date.
> The following queries taking very long time as the plan using index scan.
> Please advise for optimization.
> select *
> from production_table p -- production_table has ~10 million records
> where datediff(dd, p.Created_Date, getdate()) = 7
>
> select *
> from production_table p -- -- production_table has ~10 million
records
> where datediff(mm, p.created_date, getdate()) = 1
>
> Thanks in advance.
>|||I would try running UPDATE STATISTICS initially, then try an index hint and
then consider clustering the date column rather than the identity column. You
could also test the use of calculated columns with indexes on the calculated
columns IE: day_number and month_number.
regards,
Mark Baekdal
http://www.dbghost.com
http://www.innovartis.co.uk
+44 (0)208 241 1762
Database change management for SQL Server
"DKRReddy" wrote:
> The production_table has ~20 million records and has identity key which is
> clustered and has non clustered index on Created_Date.
> The following queries taking very long time as the plan using index scan.
> Please advise for optimization.
> select *
> from production_table p -- production_table has ~10 million records
> where datediff(dd, p.Created_Date, getdate()) = 7
>
> select *
> from production_table p -- -- production_table has ~10 million records
> where datediff(mm, p.created_date, getdate()) = 1
>
> Thanks in advance.
>
>|||Calculate the fixed date range before you query. Always list the
columns you require rather than use SELECT *.
SELECT col1, col2, ...
FROM production_table
WHERE created_date >= '20050131'
AND created_date < '20050201'
SELECT col1, col2, ...
FROM production_table
WHERE created_date >= '20050206'
AND created_date < '20050207'
--
David Portas
SQL Server MVP
--|||David is correct,... when you use a function in a where clause, the
optimizer is unable to use index statistics to determine the best index.
Pre-determining the date ranges as David suggests will give the optimizer
visibility into the index statistics... Performance will then depend on the
number of rows that satisfy the where clause...
--
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
"DKRReddy" <dkrreddy@.hotmail.com> wrote in message
news:%23$XOvrMDFHA.392@.TK2MSFTNGP14.phx.gbl...
> The production_table has ~20 million records and has identity key which
> is
> clustered and has non clustered index on Created_Date.
> The following queries taking very long time as the plan using index scan.
> Please advise for optimization.
> select *
> from production_table p -- production_table has ~10 million records
> where datediff(dd, p.Created_Date, getdate()) = 7
>
> select *
> from production_table p -- -- production_table has ~10 million
> records
> where datediff(mm, p.created_date, getdate()) = 1
>
> Thanks in advance.
>

Performance : Queries taking very long time (Urgent)

The production_table has ~20 million records and has identity key which is
clustered and has non clustered index on Created_Date.
The following queries taking very long time as the plan using index scan.
Please advise for optimization.
select *
from production_table p -- production_table has ~10 million records
where datediff(dd, p.Created_Date, getdate()) = 7
select *
from production_table p -- -- production_table has ~10 million records
where datediff(mm, p.created_date, getdate()) = 1
Thanks in advance.Hmm.. How many rows do the queries return ? Theres lots one could advice,
such as do you really need a select * or one could state, creating a
clustered index on Created_Date column or even trying to rewrite the where
clause something like
where created_date = getdate-7 and so on..
I think thats related to SARG and how the optimiser would pick the right
plan.. But with so many records, and with the select * in there, even if
does do an index seek , it would follow with a bookmark lookup to get the
rest of the data which could be expensive as well..
So without knowing a whole lot about ur application, it would be wrong for
me to really give the right solution...
Probably someone else can chime in with something better.
"DKRReddy" <dkrreddy@.hotmail.com> wrote in message
news:%23$XOvrMDFHA.392@.TK2MSFTNGP14.phx.gbl...
> The production_table has ~20 million records and has identity key which
is
> clustered and has non clustered index on Created_Date.
> The following queries taking very long time as the plan using index scan.
> Please advise for optimization.
> select *
> from production_table p -- production_table has ~10 million records
> where datediff(dd, p.Created_Date, getdate()) = 7
>
> select *
> from production_table p -- -- production_table has ~10 million
records
> where datediff(mm, p.created_date, getdate()) = 1
>
> Thanks in advance.
>|||I would try running UPDATE STATISTICS initially, then try an index hint and
then consider clustering the date column rather than the identity column. Yo
u
could also test the use of calculated columns with indexes on the calculated
columns IE: day_number and month_number.
regards,
Mark Baekdal
http://www.dbghost.com
http://www.innovartis.co.uk
+44 (0)208 241 1762
Database change management for SQL Server
"DKRReddy" wrote:

> The production_table has ~20 million records and has identity key which
is
> clustered and has non clustered index on Created_Date.
> The following queries taking very long time as the plan using index scan.
> Please advise for optimization.
> select *
> from production_table p -- production_table has ~10 million records
> where datediff(dd, p.Created_Date, getdate()) = 7
>
> select *
> from production_table p -- -- production_table has ~10 million record
s
> where datediff(mm, p.created_date, getdate()) = 1
>
> Thanks in advance.
>
>|||Calculate the fixed date range before you query. Always list the
columns you require rather than use SELECT *.
SELECT col1, col2, ...
FROM production_table
WHERE created_date >= '20050131'
AND created_date < '20050201'
SELECT col1, col2, ...
FROM production_table
WHERE created_date >= '20050206'
AND created_date < '20050207'
David Portas
SQL Server MVP
--|||David is correct,... when you use a function in a where clause, the
optimizer is unable to use index statistics to determine the best index.
Pre-determining the date ranges as David suggests will give the optimizer
visibility into the index statistics... Performance will then depend on the
number of rows that satisfy the where clause...
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
"DKRReddy" <dkrreddy@.hotmail.com> wrote in message
news:%23$XOvrMDFHA.392@.TK2MSFTNGP14.phx.gbl...
> The production_table has ~20 million records and has identity key which
> is
> clustered and has non clustered index on Created_Date.
> The following queries taking very long time as the plan using index scan.
> Please advise for optimization.
> select *
> from production_table p -- production_table has ~10 million records
> where datediff(dd, p.Created_Date, getdate()) = 7
>
> select *
> from production_table p -- -- production_table has ~10 million
> records
> where datediff(mm, p.created_date, getdate()) = 1
>
> Thanks in advance.
>