Showing posts with label explain. Show all posts
Showing posts with label explain. Show all posts

Saturday, February 25, 2012

Can anyone help with waittype 0x0044?

Hi,

I wonder if anyone can shed any light on the following as i just can't
explain it.

A user is running an update on a 500m+ row table setting a column
value, computing its value from another column in the table. It's now
been running for 23hours.

The server is Itanium 64, enterprise 2005, SAN based storage and it
usually handles anything with this volume quite quickly, probably
about 30 mins or so.

There is nothing else running currently although overnight batches,
backups etc have been running within the last 23 hours.

In sysprocess it showing the following :-

spid kpid blocked waittype waittime
lastwaittype waitresource
52 5236 0 0x0044 30
PAGEIOLATCH_EX 6:13:1754732

the process seems to stay in this waittype for a few secnds and then
goes to a 0x0000 and then back into this one again. I can see from the
IO counter that IO is increasing and also looking at the current IO i
see the following so presume the query is still working :-

select
database_id,
file_id,
io_stall,
io_pending_ms_ticks,
scheduler_address
from sys.dm_io_virtual_file_stats(NULL, NULL)t1,
sys.dm_io_pending_io_requests as t2
where t1.file_handle = t2.io_handle

gives results :-

613151115052100x0000000008624080

I just can't explain why it is so slow when nothing else is ruuning.

Anyone have any ideas on what i can check on?

Thanks

Ian.ianwr (ianwrigglesworth@.yahoo.co.uk) writes:

Quote:

Originally Posted by

A user is running an update on a 500m+ row table setting a column
value, computing its value from another column in the table. It's now
been running for 23hours.


Would the update cause the rows to grow? For instance, if this is
a new column that was added as nullable, and is now being populated?
In that case the table will need to grow, and could take some time.
Not the least if the data file has to grow as well.

Quote:

Originally Posted by

There is nothing else running currently although overnight batches,
backups etc have been running within the last 23 hours.
>
In sysprocess it showing the following :-
>
spid kpid blocked waittype waittime
lastwaittype waitresource
52 5236 0 0x0044 30
PAGEIOLATCH_EX 6:13:1754732


In sys.dm_exec_requests there is a wait_type which is likely to be
more informative than 0x0044.

Quote:

Originally Posted by

Anyone have any ideas on what i can check on?


Obviously a

SELECT COUNT(*) FROM tbl (NOLOCK) WHERE col <expected value

will you some progress information.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Hi Erland,

Thanks for the view to use, unfortunately when i arrived this morning
the task had stopped and took about 29 hours to run.

Going to keep an eye on things and check out the san as well today,
Thanks for the info anyway, if it happens again i'll repost

Thanks

Ian,

Can anyone help explain 'XactSequence' in profiler trace

Hi All

Can you explain the column 'XactSequence' in detail in SQL Server 2005 profiler trace?

Thanks in advance.

transaction sequence.

|||

Thanks, can you let me know the difference between transaction sequence and transaction id? Also, for dtc transaction, does it have transaction sequence?

|||

They're not the same. Think of a sql job where you have multiple job steps. So, the jobid is not the same as the jobstepid. It's a 1-to-many relationship.

|||

Thanks. But when will SQL create a XactSequence for the specified SQL transaction? Also, will DTC transaction have XactSequence?

Can anyone explain what the pre-execute phase is doing for OLE DB data sources using sql com

I have a project which spans multiple servers and aggregates literally billions of rows of data into a much smaller and manageable result set which I store on another server. There are two stored procedures which take up 99.9% of the processing time. Each one of these SPs are estimated to run over 3 hours a piece (gives you an indication of how much data there really is). With in this SSIS package, I have two control flows, one for each SP. When I run the SSIS package from VS2005, I can see that there is a pre-execute phase which takes about an hour abnd a half to complete, and then move on to executing. My question is, what the heck is this, and what is it doing? I know it validates the sql in the procedure, but does it actually run the SP during that pre-execute phase? If it does, is there any way to get around that?

Any help would be appreciated.

Have tried to open a SQL profiler to see what is going on on the DB server during that period?

Rafael Salas

|||Yes, I have, and I did not see anything that stood to me as a procedure call to that SP. I just want to know why it takes so long to pre-execute.

Can anyone explain this processing schedule

Hi,

I have a fairly complicated cube which has:

74 Measure groups

Each measure group contains 12 partitions

= 888 partitions in my cube

I have a parameterized XMLA processing script that processes 2 partitions in each measure group - i.e. 148 partitions. It does this inside a <Parallel></Parallel> element.

When I executed the XMLA script I recorded the progress in Profiler. I saw that, prior to processing the 148 paritions, there was lots and lots of "Progress Report End" EventClass records with a message of:

Finished processing the '<partition name>' partition

There were actually 518 of these records so whatever it is doing, it is not doing it for every single partition. Note that most of the listed partitions were NOT specified in my XMLA processing script.

I also has a trace running against the underlying source data and can see that none of these events resulted in a query being fired against the source.

So, the question is fairly simple. Why am I seeing all these "Finished processing..." events for partitions that:

    I never asked to be processed and

    Don't result ina query against the source.

Any explanation would be most welcome.

Thanks

Jamie

P.S. The .trc file from tracing AS is 2.14MB. I can provide it if anyone is interested.

It is possible you are seeing Analysis Server as part of preparing to load new data, removing data from the partitions that are no longer valid.

It does that by internally issuing ProcessClear command. ProcessClear will generate ProgressReportBegin and ProgressReportEnd commands.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Edward Melomed wrote:

It is possible you are seeing Analysis Server as part of preparing to load new data, removing data from the partitions that are no longer valid.

It does that by internally issuing ProcessClear command. ProcessClear will generate ProgressReportBegin and ProgressReportEnd commands.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

Thanks Edward but that doesn't yet explain what I am seeing.


In my scenario all the other partitions are perfectly valid. What circumstances might cause AS to think that data in those partitions was NOT valid and thus do a ProcessClear? if this is what IS happening then I am very worried.

Regards

|||

What does you processing command lists?

Does it list entire measure group or it lists individual partitions?

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Edward Melomed wrote:

What does you processing command lists?

Does it list entire measure group or it lists individual partitions?

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

Partitions only!

It also does a processUpdate on all my dimensions.

-Jamie

|||

That explains it. ProcessUpdate on dimension will case Analysis Server to drop aggregations and indexes from your partitoins. These are the events you are seeing.

To learn more about what to expect during processing you can click on Impact Analysis button in the processing dialog.

Processing dialog sends a kind of "prepare" statement to the sever and recives back a rowset with all objects affected by the processing command.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Edward Melomed wrote:

That explains it. ProcessUpdate on dimension will case Analysis Server to drop aggregations and indexes from your partitoins. These are the events you are seeing.

To learn more about what to expect during processing you can click on Impact Analysis button in the processing dialog.

Processing dialog sends a kind of "prepare" statement to the sever and recives back a rowset with all objects affected by the processing command.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.


Edward,

I knew we'd get there in the end! :)

That's great service. Thank you very much.

-Jamie

|||

And I've done a small write-up here: https://blogs.conchango.com/jamiethomson/archive/2006/07/26/4272.aspx

-Jamie

|||

If I understand this correctly, we will lose aggregations on the cube when we do process update against dimensions.

I have a following scenario, what will happen in this case then? I loop through list of dimensions (16) and conduct process update by executing DDL statememt. Once I updated the dimensions I fully process 3 partitions (Current Fiscal Period, Current Fiscal Period-1, Current Fiscal Period-2) which we expect to get new / delta fact data.

I have got 7 years worth of history data loaded into the cube. Aggregations were built based on user reporting requirements.

Question is, will I lose aggregations all together, when I process update on dimensions every night?

Thanks

Sutha

|||

Yes, you might loose some of the aggregations.

For more information about the situation try and search for term "flexible aggregations".

In short: ProcessUpdate of the dimension allows you to move hierarcy member from one paren to another. For example JonD can change city from Seattle to Portland. If you allow such change in your dimension, Analysis Server needs to drop aggregation that sums up data across cities.

If you said that customer cannot move from one city to another by setting attribute relationship between customer attribute and city attribute as Rigid, Analysis Server will not drop aggregation going across the cities. So one way to treat this situation is to set all attribute relationsip types to Rigid across all dimensions.

Another solution is to use Process Add for dimension. This option only adds new members to dimension and can change some dimension member properties, but does not move member from parent to another. So Analysis Server doesnt need to touch aggregations in this case. To use Process Add you need to make sure you build a view restricting to only new members.

And your last option is to run Process Index command across all of your old partitions to make sure you build all aggregations.

Hope that helps.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Edward

Thanks. Yes it does help. One quick question though.

In my scenario, I have a measure group with multi billion rows, but I do process 3 partitions daily. Do I have to "Process Index" for those 3 partitions or for the measure group? If I understand you correctly, I need to do Process Index against the measure group not just those 3 partitions I have just processed.

Thanks

Sutha

Can anyone explain me this please

Hi,
Can anyone explain me what the persons means by
saying: "multiple files"... how do i do this'
If your database is very large and very busy, multiple
files can be used to increase performance. Here is one
example of how you might use multiple files. Let's say you
have a single table with 10 million rows that is heavily
queried. If the table is in a single file, such as a
single database file, then SQL Server would only use one
thread to perform a read of the rows in the table. But if
the table were divided into three physical files (all part
of the same filegroup), then SQL Server would use three
threads (one per physical file) to read the table, which
potentially could be faster. In addition, if each file
were on its own separate physical disk or disk array, the
performance gain would even be greater.
Thanxs for your patience,
CC
What did you mean by
> But if the table were divided into three physical files (all part
> of the same filegroup) ?
You can place heavily accessed tables and the nonclustered indexes belonging
to those tables on different filegroups. This will improve performance, due
to parallel I/O if the files are located on different physical disks
"C" <anonymous@.discussions.microsoft.com> wrote in message
news:06a801c3ce01$93fcc010$a101280a@.phx.gbl...
> Hi,
> Can anyone explain me what the persons means by
> saying: "multiple files"... how do i do this'
> If your database is very large and very busy, multiple
> files can be used to increase performance. Here is one
> example of how you might use multiple files. Let's say you
> have a single table with 10 million rows that is heavily
> queried. If the table is in a single file, such as a
> single database file, then SQL Server would only use one
> thread to perform a read of the rows in the table. But if
> the table were divided into three physical files (all part
> of the same filegroup), then SQL Server would use three
> threads (one per physical file) to read the table, which
> potentially could be faster. In addition, if each file
> were on its own separate physical disk or disk array, the
> performance gain would even be greater.
> Thanxs for your patience,
> C|||Actually, what your paragraph is talking about is putting several data files
in a single filegroup..
You can use SEM to add more data files to the Primary filegroup.
AFTER you have multiple files in the filegroup, THEN load the data... SQL
Server will stripe the data across all of the data files. and when you do a
query, SQL will automatically use parallel IO Threads ( one for each file)
to get the data..
This can allow better performance for a single user's query....
If all of the files are in a single raid array, the rule of thumb is not
more than 8 files, and not more than one file per hard drive... So if you
are using a 4 drive raid array, create 4 data files...
Wayne Snyder, MCDBA, SQL Server MVP
Computer Education Services Corporation (CESC), Charlotte, NC
www.computeredservices.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
"C" <anonymous@.discussions.microsoft.com> wrote in message
news:06a801c3ce01$93fcc010$a101280a@.phx.gbl...
> Hi,
> Can anyone explain me what the persons means by
> saying: "multiple files"... how do i do this'
> If your database is very large and very busy, multiple
> files can be used to increase performance. Here is one
> example of how you might use multiple files. Let's say you
> have a single table with 10 million rows that is heavily
> queried. If the table is in a single file, such as a
> single database file, then SQL Server would only use one
> thread to perform a read of the rows in the table. But if
> the table were divided into three physical files (all part
> of the same filegroup), then SQL Server would use three
> threads (one per physical file) to read the table, which
> potentially could be faster. In addition, if each file
> were on its own separate physical disk or disk array, the
> performance gain would even be greater.
> Thanxs for your patience,
> C

Friday, February 24, 2012

Can any one explain this query behavior

db_TBOdb_TBT
----------
------------------
TBOID | Date TBTID| TBOID| Date
--------------------------
rp01 | 01/08/2006 ap01 |rp01|02/08/2006
many rows ap02 | rp01 |05/08/2006
ap03 |rp03|04/08/2006

I want to find TBTTD field of table db_TBT
who have of db_TBO date db_TBT table date
and TBOID should be 'rp01' of both tables

when I give a query as it works as I needed

Select TBT.Date
from db_TBO TBO , db_TBT TBT
where TBT.TBOID = 'rp01'
and TBO.TBOID ='rp01'
and TBO.Date TBT.Date

My doubt is when I run the following query
" Select TBT.Date from db_TBO TBO , db_TBT TBT where TBT.TBOID = 'rp01'
"
it gives me more than 7 records

when I run the query using some change
" Select TBT.Date , TBT.TBID from db_TBO TBO , db_TBT TBT where
TBT.TBOID = 'rp01' "
it gives more rows than previous row

Can u give me any explations.

Thanks
PaiOn 23 Aug 2006 22:54:21 -0700, pai wrote:

Quote:

Originally Posted by

>db_TBOdb_TBT
>----------
>------------------
>TBOID | Date TBTID| TBOID| Date
>--------------------------
>rp01 | 01/08/2006 ap01 |rp01|02/08/2006
>many rows ap02 | rp01 |05/08/2006
> ap03 |rp03|04/08/2006
>
>I want to find TBTTD field of table db_TBT
>who have of db_TBO date db_TBT table date
>and TBOID should be 'rp01' of both tables
>


(snip)

Quote:

Originally Posted by

>
>My doubt is when I run the following query
>" Select TBT.Date from db_TBO TBO , db_TBT TBT where TBT.TBOID = 'rp01'
>"
>it gives me more than 7 records


Hi Pai,

Of course it does. The FROM clause lists two tables, comma-seperated.
That means that you'll get a cross join, also known as cartesian
product, between the two tables: each row from the first table will be
paired with each row from the second table. After that (*), the WHERE
clause removes rows based on TBT.TBOID. The result set willl include
only TBT-rows with TBOID equal to 'rp01' - but each of those rows will
still be paired against each of the rows in db_TBO.

Quote:

Originally Posted by

>when I run the query using some change
>" Select TBT.Date , TBT.TBID from db_TBO TBO , db_TBT TBT where
>TBT.TBOID = 'rp01' "
>it gives more rows than previous row


I don't understand this. The only difference between this query and the
previous query is the addition of one more column in the WHERE clause.
That shoould never affect the number of rows returned. Are you sure that
you didn't make a mistake when you copied the SQL into your message?

(snipped from above:)

Quote:

Originally Posted by

>when I give a query as it works as I needed
>
>Select TBT.Date
>from db_TBO TBO , db_TBT TBT
>where TBT.TBOID = 'rp01'
>and TBO.TBOID ='rp01'
>and TBO.Date TBT.Date


Indeed. This query also starts (*) with the cross join, but then retains
only rows with both TBT.TBOID and TBO.TBOOID equal to 'rp01'. That means
that you're left with each TBT-row for 'rp01' paired to each TBO-row for
'rp01'. These results are then further filtered by the date comparison.

I think your problems arise out of the use of the "old-style" FROM
clause. The newer style, with explicit joins, makes it much harder to
make this kind of mistakes since it forces you to explicitly write down
the join criteria:

SELECT some columns
FROM db_TBO AS TBO
INNER JOIN db_TBT AS TBT
ON TBO.TBOID = TBT.TBOID
WHERE TBO.Date TBT.Date;

(*) The order of evaluation described here is only a logical explanation
of the process. The query optimizer is free to (and definitely will, in
this case) change the order of evaluation, as long as the results remain
the same.

--
Hugo Kornelis, SQL Server MVP