Showing posts with label following. Show all posts
Showing posts with label following. Show all posts

Friday, March 30, 2012

Question to create Measure for prior sale year and month

Hi All,

I have started with SSAS last week and getting into several options. I came across following difficulty. Please help if you have any ideas.

I’m building a report that has attributes A1, A2, A3, Year and Month and measures M1 and M2

A1

A2

A3

Year

Month

M1

M2

The M1 value is such that it is M2 of Month 6 of Year – 3.

For example, for Year 2007, month 3 the value of M2 is 100

And for year 2004, month 6 the value of M2 is 66

Then the report would be like

A1

A2

A3

Year

Month

M1

M2

a

b

c

2007

3

66

100

How to create M1 measure ?

Thanks in advance.

Sorry, but I don't quite follow what M1 represents? Is M1 the M2 value at a point in time that is 3 years prior to the current point in time?

Thanks,
Bryan

Question to create Measure for prior sale year and month

Hi All,

I have started with SSAS last week and getting into several options. I came across following difficulty. Please help if you have any ideas.

I’m building a report that has attributes A1, A2, A3, Year and Month and measures M1 and M2

A1

A2

A3

Year

Month

M1

M2

The M1 value is such that it is M2 of Month 6 of Year – 3.

For example, for Year 2007, month 3 the value of M2 is 100

And for year 2004, month 6 the value of M2 is 66

Then the report would be like

A1

A2

A3

Year

Month

M1

M2

a

b

c

2007

3

66

100

How to create M1 measure ?

Thanks in advance.

Sorry, but I don't quite follow what M1 represents? Is M1 the M2 value at a point in time that is 3 years prior to the current point in time?

Thanks,
Bryan

sql

Question related to Reporting Services vs Crystal Report

I am migrating my reports from crystal 8 to reporting services 2005 but before this my client wants answers of following question.Can anybody provide me answer or link related to mentioned question...

1 -Will there be any performance improvement when the same Report (considering big data) is being run with Sql-Server reporting services compared to the one with Crystal report engine?

2- Is it possible to make the labels which are part of Top Palette like “1 of 1”, “Find”, “Next”, “Select a format”, ‘Export” according to the Account language?

3- Can both Versions of Reporting Tools (SQL-Reporting service and Crystal Report) run on the same machine?

4- What are the limitations of this Tools like whether there are any additional load on Database Server because of the involvement of Reporting services which are installed on DB Server.

5- Whether there are additional (to Crystal Report) types of Graph formats, Export file types available?

6- How is the licensing done for SQL-Server Report services?

Please provide me the answers ASAP.

This link might help. It is a white sheet on migrating from CR to RS... http://www.microsoft.com/sql/techinfo/whitepapers/migrate-crystal-to-reporting-services.mspx

We have CR and RS on the same machine and there were no problems.

Hope this helps.

|||

WOndering how someone would get the title of "Sr. Software Engineer, SIEMENS Sr. Software Engineer, SIEMENS " and not be able to do his own homework.

Sounded to me like a school report question.

|||

hey mainiac,

If you are not aware about the things then these type of comments doesn't suits on you.

I am a pure C# and VC++ developer and currently working on three tasks simultaniously.

I am putting fresh hand on CR & RS and due to time constraint I wanted quick & exact

solution of mentioned questions.

If we can save our time by this then i think its good approach...

Although if you are not able to answer such queries then don't waste your time

here by commenting like this because this is Information Sharing Plateform for

all of us.There is no place for you and your comments in this technical word.

I hope you will understand the things.

Take care next time...

byee

|||

hi guyinkalamazoo3,

very many thanks to you for your quick reply...

Its great information..

sql

Wednesday, March 28, 2012

Question related to recovery of SQL Server database..

In the event of SQL Server recovery... I have listed the following steps
(not detailed) as per reading SQL Server books online.
Step1. Install the SQL Server and related Service Packs
Step2. Restore the master database.
Step3. Restore the msdb (to restore the DTS packages and job schedules.)
Stpe4. Restore other system databases if it is required (optional).
Step5. Restore the user databases one after the other.. (Full backup,
differential backup and transactional backup..)
My question is..
After restoring the MASTER database, all the user databases information is
restored in the master database.
So.. Is it possible to restore the user database as the entries exist in
MASTER database? Is it possible to restore the user database just like any
other time that we restore the user database under different database name?
Since I cannot test the complete scenario I am looking for your opinion..
I am using SQL Server 2K.
Thank you all for your opinion.
Hanuman
Hi,
You can restore the user databases in any order. The order will not really
matter. You can also restore the user databases with new name this will add
new entries to sysdatabases, but the old entries in sysdatabases will remain
there. Only issue is incase if you have any logins defaulted to ur old
database
name needs to be changed using SP_defaultdb system stored procedure.
Thanks
Hari
SQL Server MVP
"Hanuman Mishra" <Mishra_Hanuman@.rediffmail.com> wrote in message
news:OpwFwX8ZFHA.4000@.TK2MSFTNGP10.phx.gbl...
>
> In the event of SQL Server recovery... I have listed the following steps
> (not detailed) as per reading SQL Server books online.
> Step1. Install the SQL Server and related Service Packs
> Step2. Restore the master database.
> Step3. Restore the msdb (to restore the DTS packages and job schedules.)
> Stpe4. Restore other system databases if it is required (optional).
> Step5. Restore the user databases one after the other.. (Full backup,
> differential backup and transactional backup..)
>
> My question is..
> After restoring the MASTER database, all the user databases information is
> restored in the master database.
> So.. Is it possible to restore the user database as the entries exist in
> MASTER database? Is it possible to restore the user database just like any
> other time that we restore the user database under different database
> name?
> Since I cannot test the complete scenario I am looking for your opinion..
>
> I am using SQL Server 2K.
> Thank you all for your opinion.
> Hanuman
>

Question related to recovery of SQL Server database..

In the event of SQL Server recovery... I have listed the following steps
(not detailed) as per reading SQL Server books online.
Step1. Install the SQL Server and related Service Packs
Step2. Restore the master database.
Step3. Restore the msdb (to restore the DTS packages and job schedules.)
Stpe4. Restore other system databases if it is required (optional).
Step5. Restore the user databases one after the other.. (Full backup,
differential backup and transactional backup..)
My question is..
After restoring the MASTER database, all the user databases information is
restored in the master database.
So.. Is it possible to restore the user database as the entries exist in
MASTER database? Is it possible to restore the user database just like any
other time that we restore the user database under different database name?
Since I cannot test the complete scenario I am looking for your opinion..
I am using SQL Server 2K.
Thank you all for your opinion.
HanumanHi,
You can restore the user databases in any order. The order will not really
matter. You can also restore the user databases with new name this will add
new entries to sysdatabases, but the old entries in sysdatabases will remain
there. Only issue is incase if you have any logins defaulted to ur old
database
name needs to be changed using SP_defaultdb system stored procedure.
Thanks
Hari
SQL Server MVP
"Hanuman Mishra" <Mishra_Hanuman@.rediffmail.com> wrote in message
news:OpwFwX8ZFHA.4000@.TK2MSFTNGP10.phx.gbl...
>
> In the event of SQL Server recovery... I have listed the following steps
> (not detailed) as per reading SQL Server books online.
> Step1. Install the SQL Server and related Service Packs
> Step2. Restore the master database.
> Step3. Restore the msdb (to restore the DTS packages and job schedules.)
> Stpe4. Restore other system databases if it is required (optional).
> Step5. Restore the user databases one after the other.. (Full backup,
> differential backup and transactional backup..)
>
> My question is..
> After restoring the MASTER database, all the user databases information is
> restored in the master database.
> So.. Is it possible to restore the user database as the entries exist in
> MASTER database? Is it possible to restore the user database just like any
> other time that we restore the user database under different database
> name?
> Since I cannot test the complete scenario I am looking for your opinion..
>
> I am using SQL Server 2K.
> Thank you all for your opinion.
> Hanuman
>

Question related to recovery of SQL Server database..

In the event of SQL Server recovery... I have listed the following steps
(not detailed) as per reading SQL Server books online.
Step1. Install the SQL Server and related Service Packs
Step2. Restore the master database.
Step3. Restore the msdb (to restore the DTS packages and job schedules.)
Stpe4. Restore other system databases if it is required (optional).
Step5. Restore the user databases one after the other.. (Full backup,
differential backup and transactional backup..)
My question is..
After restoring the MASTER database, all the user databases information is
restored in the master database.
So.. Is it possible to restore the user database as the entries exist in
MASTER database? Is it possible to restore the user database just like any
other time that we restore the user database under different database name?
Since I cannot test the complete scenario I am looking for your opinion..
I am using SQL Server 2K.
Thank you all for your opinion.
HanumanHi,
You can restore the user databases in any order. The order will not really
matter. You can also restore the user databases with new name this will add
new entries to sysdatabases, but the old entries in sysdatabases will remain
there. Only issue is incase if you have any logins defaulted to ur old
database
name needs to be changed using SP_defaultdb system stored procedure.
Thanks
Hari
SQL Server MVP
"Hanuman Mishra" <Mishra_Hanuman@.rediffmail.com> wrote in message
news:OpwFwX8ZFHA.4000@.TK2MSFTNGP10.phx.gbl...
>
> In the event of SQL Server recovery... I have listed the following steps
> (not detailed) as per reading SQL Server books online.
> Step1. Install the SQL Server and related Service Packs
> Step2. Restore the master database.
> Step3. Restore the msdb (to restore the DTS packages and job schedules.)
> Stpe4. Restore other system databases if it is required (optional).
> Step5. Restore the user databases one after the other.. (Full backup,
> differential backup and transactional backup..)
>
> My question is..
> After restoring the MASTER database, all the user databases information is
> restored in the master database.
> So.. Is it possible to restore the user database as the entries exist in
> MASTER database? Is it possible to restore the user database just like any
> other time that we restore the user database under different database
> name?
> Since I cannot test the complete scenario I am looking for your opinion..
>
> I am using SQL Server 2K.
> Thank you all for your opinion.
> Hanuman
>

question regarding using the sql update command.

Here I have the following command

Dim dtNowAs DateTime = DateTime.Now
SqlDataSource1.UpdateCommand="Update [db] Set [LW]='TRUE', LWD=dtnow Where [PK]=@.PK"

What I was ttrying to accomplish was , in my grid view, when someone clicks update, it would automatically set LW to true and set LWD to today's date. No user intervention required. However, I figured the above script would not work. What would I have to do to make LWD = dtnow? I do not want to give the user the option to update anything.

Make it GetDate(). This is sql function to give u current date. No need to use a variable...

in case if u want to use variable

Dim dtNowAs DateTime = DateTime.Now

SqlDataSource1.UpdateCommand="Update [db] Set [LW]='TRUE', LWD=' " + dtnow.ToString() + " ' Where [PK]=@.PK"


|||

NICE! Thanks, anyway to clock this 3 hours ahead? The hosting company is 3 hours difference.

|||

ya that's correct os till its using my UK locationStick out tongue

question regarding slow performance an PAGEIOLATCH_SH locks on sql2005

Hi,
I wondered in anyone can help with the following problem that i'm
experiencing, i'll try to provide as much info as possible and any
suggestions would be appreciated.
I have just started at an organsiation and there seems to be slow
performance maybe on the san on a 64bit itanium dual core machine. 4
CPUs are being showed to sql server, it also has 16gb of RAM. I'll
start with the configuration of the SAN.
After speaking to the SAN guy, rather than carve the SAN up into
different area's for san Logs/Data etc they have gone for the approach
of spreading a Vdisk across as many spindles as possible (All 145 of
them). So the area that is presented to the SQL Server according the
the SAN guys is a vraid 5 stripe made up of all 145 disks which are
all 72gb fibre-channel disks.
This storage is not just made available to sql server but also made
available to other apps as well that need storage. Having read the
manufactres best practice on setting this up there is a valid argument
for doing this.
The bandwidth from the SAN is 2Gb fibre, with each computer that uses
the SAN having 2Gb fibre cards.
Clearly, that could act as a bottle-neck. But, there's nothing that
can be done about it according to the SAN guy.
Needless to say, any changes on the SAN are pretty much going to be
out of the question as far as he's concerned but i think performance
isn't that good for the type of box they have and the SAN its attached
to.
The 2nd thing i'll explain is the setup of the database in question,
firstly whoever set it up split the database into 16 different file of
4 filegroups so the table that i'm selecting to is in one filegroup
split over 4 files and the the table selecting from is in another
filegroup made up of another 4 files. These are placed on the same
physical disk made up of the SAN LUN with 145 spindles.
Anyway when i do a select from a sales table which has various group
bys and then insert the results into a blank table with no indexes it
can take over 2hours for 200k rows which i find very slow.
When i look at the sysprocesses table i am getting various waits as
follows :-
72427200x0042900PAGEIOLATCH_SH 6:9:2192094
72427200x00690SLEEP_TASK
72427200x00000SOS_SCHEDULER_YIELD
The process seams to be going inbetween a PAGEIOLATCH and
SOS_SCHEDULER_YIELD a few times per second.
Running the following to get io stalls gives the following :-
Select * from sys.dm_io_virtual_file_stats (6,7)
Select * from sys.dm_io_virtual_file_stats (6,8)
Select * from sys.dm_io_virtual_file_stats (6,9)
Select * from sys.dm_io_virtual_file_stats (6,10)
gives results like :-
67170853985015624218246512844829457222526431245540454412438340
307010565449074954240x0000000000000954
It worries me that when the process is on the PAGEIOLATCH the wait
can be over 1000. Is it normal for the wait to be this long and what
would be the best way to prove one way or another if the configuration
of the san is causing this kind of performance?
Thanks for any suggestions in advance
Ian.
The SAN setup is not necessarily a problem. Spreading the I/Os over as many
spindles as possible is in general a good approach.
There are three possible causes: (1) your SQL query is not efficient (e.g.
bad plan), (2) you are I/O throughput limited, and (3) the performance is
killed by the I/O latency problem. Point 3 is unlikely as relevant as Point 2
in this case because you query appears to be dealing a large data set.
I'd first check if an inefficient parallel plan is being used. Assume that
your I/O subsystem can do ~200MB/sec, it shouldbe able to pull in over a
terabyte of data in 2 hours unless the query plan is such that it results in
smaller I/Os or not stressing I/O at all. A bad parallelism plan can do that
to you.
You can check several perfmon counters to get a feel whether the I/O
subsystem is saturated, in particular: Avg. Disk Bytes/Read and Avg. Disk
sec/Read. The former tells you how much throughput you are using and the
latter tells you how large is each read. To efficiently process
reporting-type of queries, the latter should be relatively large. Otherwise,
the former will not be good. Ideally, the latter should be larger than 64K
and the fomer should be close to 200MB/sec.
To be sure about what kind of throughput you can get from the drive
presented from your SAN, you should run some tests. If you have a chance, try
a simple table scan on a large and wide table to see how many MBs/sec you
achieve.
BTW, are you using a sinle 2Gb card or two load-balanced 1Gb cards?
Linchi
"ianwr" wrote:

> Hi,
> I wondered in anyone can help with the following problem that i'm
> experiencing, i'll try to provide as much info as possible and any
> suggestions would be appreciated.
> I have just started at an organsiation and there seems to be slow
> performance maybe on the san on a 64bit itanium dual core machine. 4
> CPUs are being showed to sql server, it also has 16gb of RAM. I'll
> start with the configuration of the SAN.
> After speaking to the SAN guy, rather than carve the SAN up into
> different area's for san Logs/Data etc they have gone for the approach
> of spreading a Vdisk across as many spindles as possible (All 145 of
> them). So the area that is presented to the SQL Server according the
> the SAN guys is a vraid 5 stripe made up of all 145 disks which are
> all 72gb fibre-channel disks.
> This storage is not just made available to sql server but also made
> available to other apps as well that need storage. Having read the
> manufactres best practice on setting this up there is a valid argument
> for doing this.
> The bandwidth from the SAN is 2Gb fibre, with each computer that uses
> the SAN having 2Gb fibre cards.
> Clearly, that could act as a bottle-neck. But, there's nothing that
> can be done about it according to the SAN guy.
> Needless to say, any changes on the SAN are pretty much going to be
> out of the question as far as he's concerned but i think performance
> isn't that good for the type of box they have and the SAN its attached
> to.
> The 2nd thing i'll explain is the setup of the database in question,
> firstly whoever set it up split the database into 16 different file of
> 4 filegroups so the table that i'm selecting to is in one filegroup
> split over 4 files and the the table selecting from is in another
> filegroup made up of another 4 files. These are placed on the same
> physical disk made up of the SAN LUN with 145 spindles.
> Anyway when i do a select from a sales table which has various group
> bys and then insert the results into a blank table with no indexes it
> can take over 2hours for 200k rows which i find very slow.
> When i look at the sysprocesses table i am getting various waits as
> follows :-
> 72427200x0042900PAGEIOLATCH_SH 6:9:2192094
> 72427200x00690SLEEP_TASK
> 72427200x00000SOS_SCHEDULER_YIELD
> The process seams to be going inbetween a PAGEIOLATCH and
> SOS_SCHEDULER_YIELD a few times per second.
> Running the following to get io stalls gives the following :-
> Select * from sys.dm_io_virtual_file_stats (6,7)
> Select * from sys.dm_io_virtual_file_stats (6,8)
> Select * from sys.dm_io_virtual_file_stats (6,9)
> Select * from sys.dm_io_virtual_file_stats (6,10)
> gives results like :-
> 67170853985015624218246512844829457222526431245540454412438340
> 307010565449074954240x0000000000000954
> It worries me that when the process is on the PAGEIOLATCH the wait
> can be over 1000. Is it normal for the wait to be this long and what
> would be the best way to prove one way or another if the configuration
> of the san is causing this kind of performance?
> Thanks for any suggestions in advance
> Ian.
>
|||ps. The perf mon stats we are seeing are as follows :-
Avg Disk Read/Sec are between 0.06 and 0.3 on the select partion when
the routine starts up. which i think must be a little slow.
Disk Read/Sec is around 170
|||I think the SAN guy said it was a single 2gb card on the san and that
all servers that accessed the same san also used 2gb cards so he knows
this could be a bottleneck, the entire company uses this san for just
about all server ... i would estimate there must be about 6 MIS type
servers using this SAN 3 live and 3 test plus a number of smaller TP
type systems.
I'll run a few tests on the throughput and let you know
Ian
|||Ok, just done a quick table scan on a large table and the stats were
as follows :-
avg disk bytes/sec approx 76,000 which is on 76k, not exactly the
200mb a sec you had said.
Avg disk sec/read 0.6
I take it these figures aren't too good. Any idea what i can check to
see why they look so bad?
Ian.
|||stats on the tablescan are as follows :-
Avg. Disk Bytes/Read 76,000 on average which = 76k which isn't
anything near your 200mb/sec
Avg. Disk sec/Read = 0.6
Any ideas how i can narrow down exactly why the throughput is so bad?
Thanks
Ian.
|||> the former will not be good. Ideally, the latter should be larger than 64K
> and the fomer should be close to 200MB/sec.
Just noticed a mistake here. What I meant to say is that the I/O block size
(i.e. Avg Disk Bytes/Read) shoud be larger than 64K for reporting queries,
and the throughput (i.e. Avg. Read Bytes/sec) should be close to ~200MB/sec
in the ideal situation (given your setup).
Linchi
"Linchi Shea" wrote:
[vbcol=seagreen]
> The SAN setup is not necessarily a problem. Spreading the I/Os over as many
> spindles as possible is in general a good approach.
> There are three possible causes: (1) your SQL query is not efficient (e.g.
> bad plan), (2) you are I/O throughput limited, and (3) the performance is
> killed by the I/O latency problem. Point 3 is unlikely as relevant as Point 2
> in this case because you query appears to be dealing a large data set.
> I'd first check if an inefficient parallel plan is being used. Assume that
> your I/O subsystem can do ~200MB/sec, it shouldbe able to pull in over a
> terabyte of data in 2 hours unless the query plan is such that it results in
> smaller I/Os or not stressing I/O at all. A bad parallelism plan can do that
> to you.
> You can check several perfmon counters to get a feel whether the I/O
> subsystem is saturated, in particular: Avg. Disk Bytes/Read and Avg. Disk
> sec/Read. The former tells you how much throughput you are using and the
> latter tells you how large is each read. To efficiently process
> reporting-type of queries, the latter should be relatively large. Otherwise,
> the former will not be good. Ideally, the latter should be larger than 64K
> and the fomer should be close to 200MB/sec.
> To be sure about what kind of throughput you can get from the drive
> presented from your SAN, you should run some tests. If you have a chance, try
> a simple table scan on a large and wide table to see how many MBs/sec you
> achieve.
> BTW, are you using a sinle 2Gb card or two load-balanced 1Gb cards?
> Linchi
> "ianwr" wrote:
|||Just to make sure I'm raeding the right numbers. You said 76K/sec and
76K/read. These two numbers don't jive (unless the I/O subsystem is so
horribly bad). So which is which?
Assume that it's 76K/read and the thoughput in terms of bytes/sec is also in
KB's not in MB's. A latency of 0.6 second with a I/O block size of ~76K and
such a low throughput is bad. (BTW, I didn't mean to suggest 200MB/sec for
Avg. Disk Bytes/Read. Rather, I meant to say Avg. Read Bytes/sec,, i.e. the
throughput not the I/O block size. That was a typo in my previous reply).
One way to be 100% sure whether you got a raw deal on the storage is to run
some more specific I/O benchmark tests with IOMeter or sqlio.exe since that
would take SQL Server out of the picture and just focus on the performance of
the disk I/O subsystem. If the numbers are bad from IOMeter or sqlio.exe, you
can use those numbers to confront your SAN folks, and they should not have
any excuses.
Linchi
"ianwr" wrote:

> stats on the tablescan are as follows :-
> Avg. Disk Bytes/Read 76,000 on average which = 76k which isn't
> anything near your 200mb/sec
> Avg. Disk sec/Read = 0.6
> Any ideas how i can narrow down exactly why the throughput is so bad?
> Thanks
> Ian.
>
|||Thanks, will try again on monday then and see where the numbers are.
Will post back on the problem next week, but thanks for the responses
so far anyway.
Ian.
|||Holy crap! 600ms disk sec/read is absolutely horrible! This number on a
properly tuned I/O subsystem sould be 2 ORDERS OF MAGNITUDE lower! The SAN
is clearly overburdened and you will never get adequate performance with
that kind of latency.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"ianwr" <ianwrigglesworth@.yahoo.co.uk> wrote in message
news:8f28f2c6-179f-4324-8b1b-1ee378b3c157@.y43g2000hsy.googlegroups.com...
> stats on the tablescan are as follows :-
> Avg. Disk Bytes/Read 76,000 on average which = 76k which isn't
> anything near your 200mb/sec
> Avg. Disk sec/Read = 0.6
> Any ideas how i can narrow down exactly why the throughput is so bad?
> Thanks
> Ian.
sql

question regarding slow performance an PAGEIOLATCH_SH locks on sql2005

Hi,

I wondered in anyone can help with the following problem that i'm
experiencing, i'll try to provide as much info as possible and any
suggestions would be appreciated.

I have just started at an organsiation and there seems to be slow
performance maybe on the san on a 64bit itanium dual core machine. 4
CPUs are being showed to sql server, it also has 16gb of RAM. I'll
start with the configuration of the SAN.

After speaking to the SAN guy, rather than carve the SAN up into
different area's for san Logs/Data etc they have gone for the approach
of spreading a Vdisk across as many spindles as possible (All 145 of
them). So the area that is presented to the SQL Server according the
the SAN guys is a vraid 5 stripe made up of all 145 disks which are
all 72gb fibre-channel disks.

This storage is not just made available to sql server but also made
available to other apps as well that need storage. Having read the
manufactres best practice on setting this up there is a valid argument
for doing this.

The bandwidth from the SAN is 2Gb fibre, with each computer that uses
the SAN having 2Gb fibre cards.
Clearly, that could act as a bottle-neck. But, there's nothing that
can be done about it according to the SAN guy.

Needless to say, any changes on the SAN are pretty much going to be
out of the question as far as he's concerned but i think performance
isn't that good for the type of box they have and the SAN its attached
to.

The 2nd thing i'll explain is the setup of the database in question,
firstly whoever set it up split the database into 16 different file of
4 filegroups so the table that i'm selecting to is in one filegroup
split over 4 files and the the table selecting from is in another
filegroup made up of another 4 files. These are placed on the same
physical disk made up of the SAN LUN with 145 spindles.

Anyway when i do a select from a sales table which has various group
bys and then insert the results into a blank table with no indexes it
can take over 2hours for 200k rows which i find very slow.

When i look at the sysprocesses table i am getting various waits as
follows :-

72427200x0042900PAGEIOLATCH_SH 6:9:2192094
72427200x00690SLEEP_TASK
72427200x00000SOS_SCHEDULER_YIELD

The process seams to be going inbetween a PAGEIOLATCH and
SOS_SCHEDULER_YIELD a few times per second.

Running the following to get io stalls gives the following :-

Select * from sys.dm_io_virtual_file_stats (6,7)
Select * from sys.dm_io_virtual_file_stats (6,8)
Select * from sys.dm_io_virtual_file_stats (6,9)
Select * from sys.dm_io_virtual_file_stats (6,10)

gives results like :-

67170853985015624218246512844829457222526431245540454412438340
307010565449074954240x0000000000000954

It worries me that when the process is on the PAGEIOLATCH the wait
can be over 1000. Is it normal for the wait to be this long and what
would be the best way to prove one way or another if the configuration
of the san is causing this kind of performance?

Thanks for any suggestions in advance

Ian.ps. The perf mon stats we are seeing are as follows :-

Avg Disk Read/Sec are between 0.06 and 0.3 on the select partion when
the routine starts up. which i think must be a little slow.
Disk Read/Sec is around 170

question regarding slow performance an PAGEIOLATCH_SH locks on sql

Hi,
I wondered in anyone can help with the following problem that i'm
experiencing, i'll try to provide as much info as possible and any
suggestions would be appreciated.
I have just started at an organsiation and there seems to be slow
performance maybe on the san on a 64bit itanium dual core machine. 4
CPUs are being showed to sql server, it also has 16gb of RAM. I'll
start with the configuration of the SAN.
After speaking to the SAN guy, rather than carve the SAN up into
different area's for san Logs/Data etc they have gone for the approach
of spreading a Vdisk across as many spindles as possible (All 145 of
them). So the area that is presented to the SQL Server according the
the SAN guys is a vraid 5 stripe made up of all 145 disks which are
all 72gb fibre-channel disks.
This storage is not just made available to sql server but also made
available to other apps as well that need storage. Having read the
manufactres best practice on setting this up there is a valid argument
for doing this.
The bandwidth from the SAN is 2Gb fibre, with each computer that uses
the SAN having 2Gb fibre cards.
Clearly, that could act as a bottle-neck. But, there's nothing that
can be done about it according to the SAN guy.
Needless to say, any changes on the SAN are pretty much going to be
out of the question as far as he's concerned but i think performance
isn't that good for the type of box they have and the SAN its attached
to.
The 2nd thing i'll explain is the setup of the database in question,
firstly whoever set it up split the database into 16 different file of
4 filegroups so the table that i'm selecting to is in one filegroup
split over 4 files and the the table selecting from is in another
filegroup made up of another 4 files. These are placed on the same
physical disk made up of the SAN LUN with 145 spindles.
Anyway when i do a select from a sales table which has various group
bys and then insert the results into a blank table with no indexes it
can take over 2hours for 200k rows which i find very slow.
When i look at the sysprocesses table i am getting various waits as
follows :-
72 4272 0 0x0042 900 PAGEIOLATCH_SH 6:9:2192094
72 4272 0 0x0069 0 SLEEP_TASK
72 4272 0 0x0000 0 SOS_SCHEDULER_YIELD
The process seams to be going inbetween a PAGEIOLATCH and
SOS_SCHEDULER_YIELD a few times per second.
Running the following to get io stalls gives the following :-
Select * from sys.dm_io_virtual_file_stats (6,7)
Select * from sys.dm_io_virtual_file_stats (6,8)
Select * from sys.dm_io_virtual_file_stats (6,9)
Select * from sys.dm_io_virtual_file_stats (6,10)
gives results like :-
6 7 1708539850 1562421 82465128448 294572225 26431 2455404544 12438340
307010565 44907495424 0x0000000000000954
It worries me that when the process is on the PAGEIOLATCH the wait
can be over 1000. Is it normal for the wait to be this long and what
would be the best way to prove one way or another if the configuration
of the san is causing this kind of performance?
Thanks for any suggestions in advance
Ian.ps. The perf mon stats we are seeing are as follows :-
Avg Disk Read/Sec are between 0.06 and 0.3 on the select partion when
the routine starts up. which i think must be a little slow.
Disk Read/Sec is around 170|||The SAN setup is not necessarily a problem. Spreading the I/Os over as many
spindles as possible is in general a good approach.
There are three possible causes: (1) your SQL query is not efficient (e.g.
bad plan), (2) you are I/O throughput limited, and (3) the performance is
killed by the I/O latency problem. Point 3 is unlikely as relevant as Point 2
in this case because you query appears to be dealing a large data set.
I'd first check if an inefficient parallel plan is being used. Assume that
your I/O subsystem can do ~200MB/sec, it shouldbe able to pull in over a
terabyte of data in 2 hours unless the query plan is such that it results in
smaller I/Os or not stressing I/O at all. A bad parallelism plan can do that
to you.
You can check several perfmon counters to get a feel whether the I/O
subsystem is saturated, in particular: Avg. Disk Bytes/Read and Avg. Disk
sec/Read. The former tells you how much throughput you are using and the
latter tells you how large is each read. To efficiently process
reporting-type of queries, the latter should be relatively large. Otherwise,
the former will not be good. Ideally, the latter should be larger than 64K
and the fomer should be close to 200MB/sec.
To be sure about what kind of throughput you can get from the drive
presented from your SAN, you should run some tests. If you have a chance, try
a simple table scan on a large and wide table to see how many MBs/sec you
achieve.
BTW, are you using a sinle 2Gb card or two load-balanced 1Gb cards?
Linchi
"ianwr" wrote:
> Hi,
> I wondered in anyone can help with the following problem that i'm
> experiencing, i'll try to provide as much info as possible and any
> suggestions would be appreciated.
> I have just started at an organsiation and there seems to be slow
> performance maybe on the san on a 64bit itanium dual core machine. 4
> CPUs are being showed to sql server, it also has 16gb of RAM. I'll
> start with the configuration of the SAN.
> After speaking to the SAN guy, rather than carve the SAN up into
> different area's for san Logs/Data etc they have gone for the approach
> of spreading a Vdisk across as many spindles as possible (All 145 of
> them). So the area that is presented to the SQL Server according the
> the SAN guys is a vraid 5 stripe made up of all 145 disks which are
> all 72gb fibre-channel disks.
> This storage is not just made available to sql server but also made
> available to other apps as well that need storage. Having read the
> manufactres best practice on setting this up there is a valid argument
> for doing this.
> The bandwidth from the SAN is 2Gb fibre, with each computer that uses
> the SAN having 2Gb fibre cards.
> Clearly, that could act as a bottle-neck. But, there's nothing that
> can be done about it according to the SAN guy.
> Needless to say, any changes on the SAN are pretty much going to be
> out of the question as far as he's concerned but i think performance
> isn't that good for the type of box they have and the SAN its attached
> to.
> The 2nd thing i'll explain is the setup of the database in question,
> firstly whoever set it up split the database into 16 different file of
> 4 filegroups so the table that i'm selecting to is in one filegroup
> split over 4 files and the the table selecting from is in another
> filegroup made up of another 4 files. These are placed on the same
> physical disk made up of the SAN LUN with 145 spindles.
> Anyway when i do a select from a sales table which has various group
> bys and then insert the results into a blank table with no indexes it
> can take over 2hours for 200k rows which i find very slow.
> When i look at the sysprocesses table i am getting various waits as
> follows :-
> 72 4272 0 0x0042 900 PAGEIOLATCH_SH 6:9:2192094
> 72 4272 0 0x0069 0 SLEEP_TASK
> 72 4272 0 0x0000 0 SOS_SCHEDULER_YIELD
> The process seams to be going inbetween a PAGEIOLATCH and
> SOS_SCHEDULER_YIELD a few times per second.
> Running the following to get io stalls gives the following :-
> Select * from sys.dm_io_virtual_file_stats (6,7)
> Select * from sys.dm_io_virtual_file_stats (6,8)
> Select * from sys.dm_io_virtual_file_stats (6,9)
> Select * from sys.dm_io_virtual_file_stats (6,10)
> gives results like :-
> 6 7 1708539850 1562421 82465128448 294572225 26431 2455404544 12438340
> 307010565 44907495424 0x0000000000000954
> It worries me that when the process is on the PAGEIOLATCH the wait
> can be over 1000. Is it normal for the wait to be this long and what
> would be the best way to prove one way or another if the configuration
> of the san is causing this kind of performance?
> Thanks for any suggestions in advance
> Ian.
>|||I think the SAN guy said it was a single 2gb card on the san and that
all servers that accessed the same san also used 2gb cards so he knows
this could be a bottleneck, the entire company uses this san for just
about all server ... i would estimate there must be about 6 MIS type
servers using this SAN 3 live and 3 test plus a number of smaller TP
type systems.
I'll run a few tests on the throughput and let you know
Ian|||Ok, just done a quick table scan on a large table and the stats were
as follows :-
avg disk bytes/sec approx 76,000 which is on 76k, not exactly the
200mb a sec you had said.
Avg disk sec/read 0.6
I take it these figures aren't too good. Any idea what i can check to
see why they look so bad?
Ian.|||stats on the tablescan are as follows :-
Avg. Disk Bytes/Read 76,000 on average which = 76k which isn't
anything near your 200mb/sec
Avg. Disk sec/Read = 0.6
Any ideas how i can narrow down exactly why the throughput is so bad?
Thanks
Ian.|||> the former will not be good. Ideally, the latter should be larger than 64K
> and the fomer should be close to 200MB/sec.
Just noticed a mistake here. What I meant to say is that the I/O block size
(i.e. Avg Disk Bytes/Read) shoud be larger than 64K for reporting queries,
and the throughput (i.e. Avg. Read Bytes/sec) should be close to ~200MB/sec
in the ideal situation (given your setup).
Linchi
"Linchi Shea" wrote:
> The SAN setup is not necessarily a problem. Spreading the I/Os over as many
> spindles as possible is in general a good approach.
> There are three possible causes: (1) your SQL query is not efficient (e.g.
> bad plan), (2) you are I/O throughput limited, and (3) the performance is
> killed by the I/O latency problem. Point 3 is unlikely as relevant as Point 2
> in this case because you query appears to be dealing a large data set.
> I'd first check if an inefficient parallel plan is being used. Assume that
> your I/O subsystem can do ~200MB/sec, it shouldbe able to pull in over a
> terabyte of data in 2 hours unless the query plan is such that it results in
> smaller I/Os or not stressing I/O at all. A bad parallelism plan can do that
> to you.
> You can check several perfmon counters to get a feel whether the I/O
> subsystem is saturated, in particular: Avg. Disk Bytes/Read and Avg. Disk
> sec/Read. The former tells you how much throughput you are using and the
> latter tells you how large is each read. To efficiently process
> reporting-type of queries, the latter should be relatively large. Otherwise,
> the former will not be good. Ideally, the latter should be larger than 64K
> and the fomer should be close to 200MB/sec.
> To be sure about what kind of throughput you can get from the drive
> presented from your SAN, you should run some tests. If you have a chance, try
> a simple table scan on a large and wide table to see how many MBs/sec you
> achieve.
> BTW, are you using a sinle 2Gb card or two load-balanced 1Gb cards?
> Linchi
> "ianwr" wrote:
> > Hi,
> >
> > I wondered in anyone can help with the following problem that i'm
> > experiencing, i'll try to provide as much info as possible and any
> > suggestions would be appreciated.
> >
> > I have just started at an organsiation and there seems to be slow
> > performance maybe on the san on a 64bit itanium dual core machine. 4
> > CPUs are being showed to sql server, it also has 16gb of RAM. I'll
> > start with the configuration of the SAN.
> >
> > After speaking to the SAN guy, rather than carve the SAN up into
> > different area's for san Logs/Data etc they have gone for the approach
> > of spreading a Vdisk across as many spindles as possible (All 145 of
> > them). So the area that is presented to the SQL Server according the
> > the SAN guys is a vraid 5 stripe made up of all 145 disks which are
> > all 72gb fibre-channel disks.
> >
> > This storage is not just made available to sql server but also made
> > available to other apps as well that need storage. Having read the
> > manufactres best practice on setting this up there is a valid argument
> > for doing this.
> >
> > The bandwidth from the SAN is 2Gb fibre, with each computer that uses
> > the SAN having 2Gb fibre cards.
> > Clearly, that could act as a bottle-neck. But, there's nothing that
> > can be done about it according to the SAN guy.
> >
> > Needless to say, any changes on the SAN are pretty much going to be
> > out of the question as far as he's concerned but i think performance
> > isn't that good for the type of box they have and the SAN its attached
> > to.
> >
> > The 2nd thing i'll explain is the setup of the database in question,
> > firstly whoever set it up split the database into 16 different file of
> > 4 filegroups so the table that i'm selecting to is in one filegroup
> > split over 4 files and the the table selecting from is in another
> > filegroup made up of another 4 files. These are placed on the same
> > physical disk made up of the SAN LUN with 145 spindles.
> >
> > Anyway when i do a select from a sales table which has various group
> > bys and then insert the results into a blank table with no indexes it
> > can take over 2hours for 200k rows which i find very slow.
> >
> > When i look at the sysprocesses table i am getting various waits as
> > follows :-
> >
> > 72 4272 0 0x0042 900 PAGEIOLATCH_SH 6:9:2192094
> > 72 4272 0 0x0069 0 SLEEP_TASK
> > 72 4272 0 0x0000 0 SOS_SCHEDULER_YIELD
> >
> > The process seams to be going inbetween a PAGEIOLATCH and
> > SOS_SCHEDULER_YIELD a few times per second.
> >
> > Running the following to get io stalls gives the following :-
> >
> > Select * from sys.dm_io_virtual_file_stats (6,7)
> > Select * from sys.dm_io_virtual_file_stats (6,8)
> > Select * from sys.dm_io_virtual_file_stats (6,9)
> > Select * from sys.dm_io_virtual_file_stats (6,10)
> >
> > gives results like :-
> >
> > 6 7 1708539850 1562421 82465128448 294572225 26431 2455404544 12438340
> > 307010565 44907495424 0x0000000000000954
> >
> > It worries me that when the process is on the PAGEIOLATCH the wait
> > can be over 1000. Is it normal for the wait to be this long and what
> > would be the best way to prove one way or another if the configuration
> > of the san is causing this kind of performance?
> >
> > Thanks for any suggestions in advance
> >
> > Ian.
> >|||Just to make sure I'm raeding the right numbers. You said 76K/sec and
76K/read. These two numbers don't jive (unless the I/O subsystem is so
horribly bad). So which is which?
Assume that it's 76K/read and the thoughput in terms of bytes/sec is also in
KB's not in MB's. A latency of 0.6 second with a I/O block size of ~76K and
such a low throughput is bad. (BTW, I didn't mean to suggest 200MB/sec for
Avg. Disk Bytes/Read. Rather, I meant to say Avg. Read Bytes/sec,, i.e. the
throughput not the I/O block size. That was a typo in my previous reply).
One way to be 100% sure whether you got a raw deal on the storage is to run
some more specific I/O benchmark tests with IOMeter or sqlio.exe since that
would take SQL Server out of the picture and just focus on the performance of
the disk I/O subsystem. If the numbers are bad from IOMeter or sqlio.exe, you
can use those numbers to confront your SAN folks, and they should not have
any excuses.
Linchi
"ianwr" wrote:
> stats on the tablescan are as follows :-
> Avg. Disk Bytes/Read 76,000 on average which = 76k which isn't
> anything near your 200mb/sec
> Avg. Disk sec/Read = 0.6
> Any ideas how i can narrow down exactly why the throughput is so bad?
> Thanks
> Ian.
>|||Thanks, will try again on monday then and see where the numbers are.
Will post back on the problem next week, but thanks for the responses
so far anyway.
Ian.|||Holy crap! 600ms disk sec/read is absolutely horrible! This number on a
properly tuned I/O subsystem sould be 2 ORDERS OF MAGNITUDE lower! The SAN
is clearly overburdened and you will never get adequate performance with
that kind of latency.
--
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"ianwr" <ianwrigglesworth@.yahoo.co.uk> wrote in message
news:8f28f2c6-179f-4324-8b1b-1ee378b3c157@.y43g2000hsy.googlegroups.com...
> stats on the tablescan are as follows :-
> Avg. Disk Bytes/Read 76,000 on average which = 76k which isn't
> anything near your 200mb/sec
> Avg. Disk sec/Read = 0.6
> Any ideas how i can narrow down exactly why the throughput is so bad?
> Thanks
> Ian.|||Guys,
Just a quick update on the performance, here are the performance
counters i took this morning running the table scan again :-
Disk Rad Bytes.Sec = between 11m and 33m was very choppy. so i guess
this is about 10 times too slow as it's on average about 20mb/sec
rather than the 200mb you were expecting.
Avg Disk Bytes/Read was around the 77k mark
Avg Disk Sec/Read was around the 0.7 mark but at times went upto
1.2 ... pretty shocking. Going to get sqlio on the job and see if we
can get some timing to go back to the SAN guys with.
Ian.|||One very interesting point to note, i did the same on an identical
server that is running sql 2000 rather than 2005, according to the san
guy its setup identical and the performance times were very different.
throughput was 80mb/sec rather than 20mb/sec and latency was 30ms
rather than the 600-700ms. I tried 3 or 4 times with the same query
and results were constant.
Gone back to the SAN guy and asked him to confirm everything was
identical. If he says they are will run SQLio on the server to confirm
if SQL server is the culprit or the configurations are indeed
different.
Ian,|||There is definitely something different somewhere. It could possibly be
linked to OS file level fragmentation, but I doubt that could be the sole
reason for that level of throughput/latency issues.
--
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"ianwr" <ianwrigglesworth@.yahoo.co.uk> wrote in message
news:61d00455-495f-428a-9fa4-4712d861933b@.x69g2000hsx.googlegroups.com...
> One very interesting point to note, i did the same on an identical
> server that is running sql 2000 rather than 2005, according to the san
> guy its setup identical and the performance times were very different.
> throughput was 80mb/sec rather than 20mb/sec and latency was 30ms
> rather than the 600-700ms. I tried 3 or 4 times with the same query
> and results were constant.
> Gone back to the SAN guy and asked him to confirm everything was
> identical. If he says they are will run SQLio on the server to confirm
> if SQL server is the culprit or the configurations are indeed
> different.
>
> Ian,|||Disk sec/read is extraordinarily high. You don't need a sqlio run to give
something to the SAN guys IMHO. 700-1200ms latency is way more than enough.
--
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"ianwr" <ianwrigglesworth@.yahoo.co.uk> wrote in message
news:e608dedf-961a-48cd-b53f-60df4df1d1ec@.e67g2000hsc.googlegroups.com...
> Guys,
> Just a quick update on the performance, here are the performance
> counters i took this morning running the table scan again :-
> Disk Rad Bytes.Sec = between 11m and 33m was very choppy. so i guess
> this is about 10 times too slow as it's on average about 20mb/sec
> rather than the 200mb you were expecting.
> Avg Disk Bytes/Read was around the 77k mark
> Avg Disk Sec/Read was around the 0.7 mark but at times went upto
> 1.2 ... pretty shocking. Going to get sqlio on the job and see if we
> can get some timing to go back to the SAN guys with.
> Ian.
>
>|||Will keep you posted and let you know what it was when i get to the
bottom of it.|||On the contrary, I'd strongly recommend running sqlio or IOMeter precisely
because something is fishy and you need to be able to defend your position.
If you don't run sqlio/IOMeter (or any reliable disk I/O benchmark that is
independent of SQL Server), your SAN folks can argue that the SAN config is
identical, and it must be something with SQL Server. How do you respond to
that if you only have SQL-dependent results?
Linchi
"TheSQLGuru" wrote:
> Disk sec/read is extraordinarily high. You don't need a sqlio run to give
> something to the SAN guys IMHO. 700-1200ms latency is way more than enough.
> --
> Kevin G. Boles
> TheSQLGuru
> Indicium Resources, Inc.
>
> "ianwr" <ianwrigglesworth@.yahoo.co.uk> wrote in message
> news:e608dedf-961a-48cd-b53f-60df4df1d1ec@.e67g2000hsc.googlegroups.com...
> > Guys,
> >
> > Just a quick update on the performance, here are the performance
> > counters i took this morning running the table scan again :-
> >
> > Disk Rad Bytes.Sec = between 11m and 33m was very choppy. so i guess
> > this is about 10 times too slow as it's on average about 20mb/sec
> > rather than the 200mb you were expecting.
> >
> > Avg Disk Bytes/Read was around the 77k mark
> >
> > Avg Disk Sec/Read was around the 0.7 mark but at times went upto
> > 1.2 ... pretty shocking. Going to get sqlio on the job and see if we
> > can get some timing to go back to the SAN guys with.
> >
> > Ian.
> >
> >
> >
>
>|||> throughput was 80mb/sec rather than 20mb/sec and latency was 30ms
> rather than the 600-700ms. I tried 3 or 4 times with the same query
> and results were constant.
For the latency of 30ms, was the I/O size around 70K as you previously
reported? make sure that when you compare 30ms with 600ms in latency, they
are doing the same kind of I/Os, especially they are issuing the same sized
I/Os.
When you have a chance to run sqlio or IOMeter, you should cover both small
sized I/Os and large sized I/Os. With small sized I/Os (e.g. ~<= 8K per read
or write), pay attention to latency.
Linchi
"ianwr" wrote:
> One very interesting point to note, i did the same on an identical
> server that is running sql 2000 rather than 2005, according to the san
> guy its setup identical and the performance times were very different.
> throughput was 80mb/sec rather than 20mb/sec and latency was 30ms
> rather than the 600-700ms. I tried 3 or 4 times with the same query
> and results were constant.
> Gone back to the SAN guy and asked him to confirm everything was
> identical. If he says they are will run SQLio on the server to confirm
> if SQL server is the culprit or the configurations are indeed
> different.
>
> Ian,
>|||Linchi,
I ran SQLio and the reports were suprising .. and glad did. On the 3
boxes we have i ran 64K block sizes and on all 3 boxes they were
reading about 140-170mb/sec and latency was 6-7ms. I ran this multiple
times with the same results.
I then went back to the sql2005 box and ran the table scan and results
were as before i.e. latency 300-400ms peaking to 2000ms and throughput
at about 20mb/sec. I ran SQLIO again on this same box and the results
were the same as previous ie. 6-7ms and 160mb/sec throughput. very
strange.
So it doesn't look like its anything to do with the san but with sql
2005 communicating with the IO Subsystem somehow. I ran the table scan
on the sql 2000 box and latency was 30ms with throughput at 80mb/sec.
So for some reason the sql2000 box seems to run much quicker than the
two 2005 boxes which are running much slower. But the san is fine on
all three.
I did think it could be fragmentation on the disks at the O/S level
but why would this just be the case on the sql2005 boxes. As there
isn't much disk space left on these disks de-fragmenting them to test
this out would be a pain.
I do know that a lot of the hardware drivers and service packs are out
of date on all these servers and maybe this is having something to do
with it. But as this organisation doesn't have a proper dev
environment they are reluctant to upgrade everything to the most
recent versions.
Do you have any other ideas on what i could try?
Thanks
ian.

question regarding slow performance an PAGEIOLATCH_SH locks on sql

Hi,
I wondered in anyone can help with the following problem that i'm
experiencing, i'll try to provide as much info as possible and any
suggestions would be appreciated.
I have just started at an organsiation and there seems to be slow
performance maybe on the san on a 64bit itanium dual core machine. 4
CPUs are being showed to sql server, it also has 16gb of RAM. I'll
start with the configuration of the SAN.
After speaking to the SAN guy, rather than carve the SAN up into
different area's for san Logs/Data etc they have gone for the approach
of spreading a Vdisk across as many spindles as possible (All 145 of
them). So the area that is presented to the SQL Server according the
the SAN guys is a vraid 5 stripe made up of all 145 disks which are
all 72gb fibre-channel disks.
This storage is not just made available to sql server but also made
available to other apps as well that need storage. Having read the
manufactres best practice on setting this up there is a valid argument
for doing this.
The bandwidth from the SAN is 2Gb fibre, with each computer that uses
the SAN having 2Gb fibre cards.
Clearly, that could act as a bottle-neck. But, there's nothing that
can be done about it according to the SAN guy.
Needless to say, any changes on the SAN are pretty much going to be
out of the question as far as he's concerned but i think performance
isn't that good for the type of box they have and the SAN its attached
to.
The 2nd thing i'll explain is the setup of the database in question,
firstly whoever set it up split the database into 16 different file of
4 filegroups so the table that i'm selecting to is in one filegroup
split over 4 files and the the table selecting from is in another
filegroup made up of another 4 files. These are placed on the same
physical disk made up of the SAN LUN with 145 spindles.
Anyway when i do a select from a sales table which has various group
bys and then insert the results into a blank table with no indexes it
can take over 2hours for 200k rows which i find very slow.
When i look at the sysprocesses table i am getting various waits as
follows :-
72 4272 0 0x0042 900 PAGEIOLATCH_SH 6:9:2192094
72 4272 0 0x0069 0 SLEEP_TASK
72 4272 0 0x0000 0 SOS_SCHEDULER_YIELD
The process seams to be going inbetween a PAGEIOLATCH and
SOS_SCHEDULER_YIELD a few times per second.
Running the following to get io stalls gives the following :-
Select * from sys.dm_io_virtual_file_stats (6,7)
Select * from sys.dm_io_virtual_file_stats (6,8)
Select * from sys.dm_io_virtual_file_stats (6,9)
Select * from sys.dm_io_virtual_file_stats (6,10)
gives results like :-
6 7 1708539850 1562421 82465128448 29457
2225 26431 2455404544 12438340
307010565 44907495424 0x0000000000000954
It worries me that when the process is on the PAGEIOLATCH the wait
can be over 1000. Is it normal for the wait to be this long and what
would be the best way to prove one way or another if the configuration
of the san is causing this kind of performance?
Thanks for any suggestions in advance
Ian.The SAN setup is not necessarily a problem. Spreading the I/Os over as many
spindles as possible is in general a good approach.
There are three possible causes: (1) your SQL query is not efficient (e.g.
bad plan), (2) you are I/O throughput limited, and (3) the performance is
killed by the I/O latency problem. Point 3 is unlikely as relevant as Point
2
in this case because you query appears to be dealing a large data set.
I'd first check if an inefficient parallel plan is being used. Assume that
your I/O subsystem can do ~200MB/sec, it shouldbe able to pull in over a
terabyte of data in 2 hours unless the query plan is such that it results in
smaller I/Os or not stressing I/O at all. A bad parallelism plan can do that
to you.
You can check several perfmon counters to get a feel whether the I/O
subsystem is saturated, in particular: Avg. Disk Bytes/Read and Avg. Disk
sec/Read. The former tells you how much throughput you are using and the
latter tells you how large is each read. To efficiently process
reporting-type of queries, the latter should be relatively large. Otherwise,
the former will not be good. Ideally, the latter should be larger than 64K
and the fomer should be close to 200MB/sec.
To be sure about what kind of throughput you can get from the drive
presented from your SAN, you should run some tests. If you have a chance, tr
y
a simple table scan on a large and wide table to see how many MBs/sec you
achieve.
BTW, are you using a sinle 2Gb card or two load-balanced 1Gb cards?
Linchi
"ianwr" wrote:

> Hi,
> I wondered in anyone can help with the following problem that i'm
> experiencing, i'll try to provide as much info as possible and any
> suggestions would be appreciated.
> I have just started at an organsiation and there seems to be slow
> performance maybe on the san on a 64bit itanium dual core machine. 4
> CPUs are being showed to sql server, it also has 16gb of RAM. I'll
> start with the configuration of the SAN.
> After speaking to the SAN guy, rather than carve the SAN up into
> different area's for san Logs/Data etc they have gone for the approach
> of spreading a Vdisk across as many spindles as possible (All 145 of
> them). So the area that is presented to the SQL Server according the
> the SAN guys is a vraid 5 stripe made up of all 145 disks which are
> all 72gb fibre-channel disks.
> This storage is not just made available to sql server but also made
> available to other apps as well that need storage. Having read the
> manufactres best practice on setting this up there is a valid argument
> for doing this.
> The bandwidth from the SAN is 2Gb fibre, with each computer that uses
> the SAN having 2Gb fibre cards.
> Clearly, that could act as a bottle-neck. But, there's nothing that
> can be done about it according to the SAN guy.
> Needless to say, any changes on the SAN are pretty much going to be
> out of the question as far as he's concerned but i think performance
> isn't that good for the type of box they have and the SAN its attached
> to.
> The 2nd thing i'll explain is the setup of the database in question,
> firstly whoever set it up split the database into 16 different file of
> 4 filegroups so the table that i'm selecting to is in one filegroup
> split over 4 files and the the table selecting from is in another
> filegroup made up of another 4 files. These are placed on the same
> physical disk made up of the SAN LUN with 145 spindles.
> Anyway when i do a select from a sales table which has various group
> bys and then insert the results into a blank table with no indexes it
> can take over 2hours for 200k rows which i find very slow.
> When i look at the sysprocesses table i am getting various waits as
> follows :-
> 72 4272 0 0x0042 900 PAGEIOLATCH_SH 6:9:2192094
> 72 4272 0 0x0069 0 SLEEP_TASK
> 72 4272 0 0x0000 0 SOS_SCHEDULER_YIELD
> The process seams to be going inbetween a PAGEIOLATCH and
> SOS_SCHEDULER_YIELD a few times per second.
> Running the following to get io stalls gives the following :-
> Select * from sys.dm_io_virtual_file_stats (6,7)
> Select * from sys.dm_io_virtual_file_stats (6,8)
> Select * from sys.dm_io_virtual_file_stats (6,9)
> Select * from sys.dm_io_virtual_file_stats (6,10)
> gives results like :-
> 6 7 1708539850 1562421 82465128448 29457
2225 26431 2455404544 12438340
> 307010565 44907495424 0x0000000000000954
> It worries me that when the process is on the PAGEIOLATCH the wait
> can be over 1000. Is it normal for the wait to be this long and what
> would be the best way to prove one way or another if the configuration
> of the san is causing this kind of performance?
> Thanks for any suggestions in advance
> Ian.
>|||Holy crap! 600ms disk sec/read is absolutely horrible! This number on a
properly tuned I/O subsystem sould be 2 ORDERS OF MAGNITUDE lower! The SAN
is clearly overburdened and you will never get adequate performance with
that kind of latency.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"ianwr" <ianwrigglesworth@.yahoo.co.uk> wrote in message
news:8f28f2c6-179f-4324-8b1b-1ee378b3c157@.y43g2000hsy.googlegroups.com...
> stats on the tablescan are as follows :-
> Avg. Disk Bytes/Read 76,000 on average which = 76k which isn't
> anything near your 200mb/sec
> Avg. Disk sec/Read = 0.6
> Any ideas how i can narrow down exactly why the throughput is so bad?
> Thanks
> Ian.|||There is definitely something different somewhere. It could possibly be
linked to OS file level fragmentation, but I doubt that could be the sole
reason for that level of throughput/latency issues.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"ianwr" <ianwrigglesworth@.yahoo.co.uk> wrote in message
news:61d00455-495f-428a-9fa4-4712d861933b@.x69g2000hsx.googlegroups.com...
> One very interesting point to note, i did the same on an identical
> server that is running sql 2000 rather than 2005, according to the san
> guy its setup identical and the performance times were very different.
> throughput was 80mb/sec rather than 20mb/sec and latency was 30ms
> rather than the 600-700ms. I tried 3 or 4 times with the same query
> and results were constant.
> Gone back to the SAN guy and asked him to confirm everything was
> identical. If he says they are will run SQLio on the server to confirm
> if SQL server is the culprit or the configurations are indeed
> different.
>
> Ian,|||Disk sec/read is extraordinarily high. You don't need a sqlio run to give
something to the SAN guys IMHO. 700-1200ms latency is way more than enough.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"ianwr" <ianwrigglesworth@.yahoo.co.uk> wrote in message
news:e608dedf-961a-48cd-b53f-60df4df1d1ec@.e67g2000hsc.googlegroups.com...
> Guys,
> Just a quick update on the performance, here are the performance
> counters i took this morning running the table scan again :-
> Disk Rad Bytes.Sec = between 11m and 33m was very choppy. so i guess
> this is about 10 times too slow as it's on average about 20mb/sec
> rather than the 200mb you were expecting.
> Avg Disk Bytes/Read was around the 77k mark
> Avg Disk Sec/Read was around the 0.7 mark but at times went upto
> 1.2 ... pretty shocking. Going to get sqlio on the job and see if we
> can get some timing to go back to the SAN guys with.
> Ian.
>
>

Question Regarding Scenario On DataMining

Hi to all

I want to know how achieve the following scenario, I will highly encourage if anyone knows the solution please mention it through steps. The scenario is I have a table named “CreditCardTable ” with following schema , the table is pretty much what one expect from a simple credit card application that will present form to user who fills the application of credit card and data going to be filled into the table. Later an analyst will review the data and will be accepting or rejecting the Credit Card along with some other fields as seen in the schema.

--Schema --
CustomerName Bigint
Age int
DOB DateTime
LimitAssigned Bigint
Analystname varchar
Salary varchar
Gender bit
Qualification varchar
Country varchar
JobTitle varchar
MartialStatus varchar
IsApproved bit
IsDeclined bit

Now what I want is that by using Microsoft Detaining Features after giving it the data t should purpose analyst the solution i-e (reject / approve ) the credit card application . Now I gather than there are many algorithms in SQL Server 2005 Analysis Services that can be used (Decision Trees , Association Rules ) , I research on the two I just mentioned and want to use Decision Tree for this purpose , but there is a bottleneck that is mentioned in a book named “Detaining with SQL Server 2005 by Wiely”. It says that the rules that the Decision Tree will build and use are not available to end user in contrast to Association Rule algorithm which provide the rules. I essentially need the rules by which the decision has been made. Please I really need help on these issue to summarize I need the following

1) With the table “CreditCardTable” I need to perform Decision Trees and Association Rules Algorithm on it , please provide me steps to do so , moreover please also mention how to specify Query (DMX I think) to get the final result i-e approve or reject based on the data .

2) The rules on basis of which the Algorithm makes it decision, please provide insights on how to achieve this by both Decision Trees and Association Rules Algorithm.

I really need an urgent reply on this , you can also email me at razi_rais@.yahoo.com , thanks for your feedback.

Here is a tutorial for building a mining model: http://www.sqlserverdatamining.com/DMCommunity/Tutorials/Links_LinkRedirector.aspx?id=60 . Note that the site requires you to create a (free) user account in order to download documents. One of the examples in the tutorial explains how to create a decision trees model in order to predict whether a customer is a Bike Buyer or not. I think that example is very similar to your problem. I would expect the Decision Tree algorithm to do a much better job in this case than Association Rules, but there is no harm in trying both.

One more suggestion: if IsApproved and IsDeclined describe basically the same thing (i.e., IsApproved = 1 - IsDeclined), I would ignore the IsDeclined column and only build a mining model with IsApproved as target. This way, the model will predict 1 or 0 for the IsApproved column, and you can conclude that 0 means IsDeclined.

On the query issue: there are two kinds of queries you might be interested in executing:

1) The so-called 'singleton' query -- allows executing a prediction for a new row. Example:

SELECT IsApproved FROM MyModel [NATURAL] PREDICTION JOIN (SELECT 30 as Age, 50000 as LimitAssigned ..... ) AS T [ON...]

This executes a prediction against a customer represented by the fields in the inner select statement

2) The 'batch' query -- allows executing predictions against a table or view (a collection of rows) and it is optimized for performance. Syntax:

SELECT IsApproved FROM MyModel [NATURAL] PREDICTION JOIN OPENQUERY(DataSource, 'Query') AS T [ON...]

The query builder tool inside BI Dev Studio can be used to generate both kinds of queries. Note that the prediction query is independent of the algorithm. That means that you can use these queries with both Association Rules and Decision Trees.

On the last issue (rules), the answer is different, depending on the algorith. Association Rules is designed to construct rules. The rules can be inspected visually in the viewer. In the case of Decision Trees, the rule would be the path from the root of the tree to the leaf node that is used in prediction. Clicking on a decision trees node in the model viewer will present the information for that node, including the rule (in the form of Node Path from the root to that node)

For decision trees, you can extract the rule that leads to each individual prediction. Details here: http://www.sqlserverdatamining.com/DMCommunity/TipsNTricks/784.aspx

|||

Thanks Bogdan for your prompt reply I will be reviewing the links you provided .Regarding the Rules I reviewed description at http://www.sqlserverdatamining.com/DMCommunity/TipsNTricks/784.aspx , now can you please tell me is there any way to get whole set of rules not only the branch executed for making the decison in the form of xml. I mean like say after the mining algorithm executes and hence trained on the data can we write some function that return us whole rules (preferbly in form of xml) that will be used to make the design.

Best Regards

Razi

|||

You can try

SELECT NODE_RULE, NODE_CAPTION FROM MyModel.CONTENT

This will return the rules and the XMl representation of the rules for each tree node. However, you need to manually analyze the distribution for each node to see what the prediction is for that rule (the returned results contain the left hand side of the rule).

|||

Hmm what i want to know is when you guys want to capture complete rules and want to do it without mannual interction is there is any possiblity to do so ? I mean is microsoft provide any Object Model on top of this so that I can capture whole rules like

If <xyz> then <abc>

If <abc> then <pqr>

If <pqr> then <swf>

I think there might be any possibility to acieve this or is plainly impossible to achieve using Datamining in SQL 2005.

One more thing i want to ask is the query u mentioned

SELECT NODE_RULE, NODE_CAPTION FROM MyModel.CONTENT is independent of Algorithm used ? If it is then which model is more effective among DST and AR for prediction purposes specially in Credit Card Application Scenarion that i mentioned in the first post , you mentioned DS but can please amplify why and how to capture its inner workings?

|||

It really depends on what you want to do. Association rules provides rules of the sort

A,B,C -> D

Decision trees gives you rules of the form

If A and B and C then D

In both cases rules are probabilistic.

All data mining algorithms expose their content though the content schema rowset which has an specified form, and each algorithm uses that form as appropriate for that algorithm. For example, the content for a tree model is a parent-child rowset with each row indicating a node in the tree. For Association Rules, each row is either an itemset or a rule. You can access the content through the queries like Bogdan specifies, or using the object model with ADOMD.Net. The object model essentially wraps the content and provides easier navigation, but it's the same. On SQL Server Data MIning.com there is a sample viewer that allows you to view the raw content in an easier way, and it contains source code. That may be a good place to start.

Monday, March 26, 2012

Question regarding calculated fields in reporting services 2005

Is there a concept of scope for calculated fields? I tried the
following and VS crashed.
=IIf(RowNumber("GroupName") = 1, MyValue, 0)
Example of what I am trying to accomplish.
GroupID, MyValue
1, 5
1, 5
1, 5
2, 10
3, 20
3, 20
========== Average MyValue should be (5 + 10 + 20)/3...not (5+5+5+10+20+20)/5.
MyValue would be the same for each GroupID. Does this make sense?Hi,
Infact you can use "Avg()" itself it has a scope parameter.
Amarnath
"Nergock@.gmail.com" wrote:
> Is there a concept of scope for calculated fields? I tried the
> following and VS crashed.
> =IIf(RowNumber("GroupName") = 1, MyValue, 0)
> Example of what I am trying to accomplish.
> GroupID, MyValue
> 1, 5
> 1, 5
> 1, 5
> 2, 10
> 3, 20
> 3, 20
> ==========> Average MyValue should be (5 + 10 + 20)/3...not (5+5+5+10+20+20)/5.
> MyValue would be the same for each GroupID. Does this make sense?
>

Question regarding C#

Hi All
I have following questions regarding C# Assembly and Threading.
Let me know the precise answer or lead me to the proper materials.
1. Is memory leakeage possible in .Net Manager Code ?
2. Is memory leakage possible in .Net Unmanaged Code ?
3. How can I find the what % of memory is being used by DLL at run time ?
4. What is difference between Sunchronous processing and Async
processing in .Net ? How can I achieve it ?
5. Can any one lead me towards Multithreading GUI development in Winforms ?
6. Difference between Delegate and Event ?
7. Is there any specific Design Patterns specifically for WinForms ?
Awaiting reply
Thanks
Silent Ocean
Hi
You may want to ask this in one of the microsoft.public.donet.* groups and
not here in the SQL Server one.
Don't multipost as that is the quickest way not to get an answer.
Regards
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Silent Ocean" <silentocean555@.yahoo.com> wrote in message
news:uuq1s$lkFHA.3936@.TK2MSFTNGP10.phx.gbl...
> Hi All
> I have following questions regarding C# Assembly and Threading.
> Let me know the precise answer or lead me to the proper materials.
> 1. Is memory leakeage possible in .Net Manager Code ?
> 2. Is memory leakage possible in .Net Unmanaged Code ?
> 3. How can I find the what % of memory is being used by DLL at run time ?
> 4. What is difference between Sunchronous processing and Async processing
> in .Net ? How can I achieve it ?
> 5. Can any one lead me towards Multithreading GUI development in Winforms
> ?
> 6. Difference between Delegate and Event ?
> 7. Is there any specific Design Patterns specifically for WinForms ?
> Awaiting reply
> Thanks
> Silent Ocean
sql

Question regarding C#

Hi All
I have following questions regarding C# Assembly and Threading.
Let me know the precise answer or lead me to the proper materials.
1. Is memory leakeage possible in .Net Manager Code ?
2. Is memory leakage possible in .Net Unmanaged Code ?
3. How can I find the what % of memory is being used by DLL at run time ?
4. What is difference between Sunchronous processing and Async
processing in .Net ? How can I achieve it ?
5. Can any one lead me towards Multithreading GUI development in Winforms ?
6. Difference between Delegate and Event ?
7. Is there any specific Design Patterns specifically for WinForms ?
Awaiting reply
Thanks
Silent OceanHi
You may want to ask this in one of the microsoft.public.donet.* groups and
not here in the SQL Server one.
Don't multipost as that is the quickest way not to get an answer.
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Silent Ocean" <silentocean555@.yahoo.com> wrote in message
news:uuq1s$lkFHA.3936@.TK2MSFTNGP10.phx.gbl...
> Hi All
> I have following questions regarding C# Assembly and Threading.
> Let me know the precise answer or lead me to the proper materials.
> 1. Is memory leakeage possible in .Net Manager Code ?
> 2. Is memory leakage possible in .Net Unmanaged Code ?
> 3. How can I find the what % of memory is being used by DLL at run time ?
> 4. What is difference between Sunchronous processing and Async processing
> in .Net ? How can I achieve it ?
> 5. Can any one lead me towards Multithreading GUI development in Winforms
> ?
> 6. Difference between Delegate and Event ?
> 7. Is there any specific Design Patterns specifically for WinForms ?
> Awaiting reply
> Thanks
> Silent Ocean