Showing posts with label timeout. Show all posts
Showing posts with label timeout. Show all posts

Monday, March 26, 2012

Latching Errors

Hi all,

We are trying to load a batch in a huge table ( 150 GB) , but sometimes we are getting timeout errors .

When i see in activity monitor, i can see some entries like PAGEIOLATCH_EX, PAGEIOLATCH_SH.

Can somebody suggets me the workaround for this problem.

Thanks for all your help.

Configuration:

Sql Server 2005 SP1, 4GB Memory, Windows 2003 standard Edition SP1

Could you post an example of the error you are getting?

Can you check what level of growth is specified for you data/log files please? eg 10% or 100MB....
|||

Hi Rich,

Growth for the data file = 2000 MB , Unrestricted Growth. and log file = 10% Unrestricted growth.

And about error, when i see in the activity monitor , i can see PAGEIOLATCH_EX, PAGEIOLATCH_SH, in the wait type column. ( its taking a long time, for rolling back the batch)

Is there anything about indexes , which affects this kind of error.

Thanks.

|||

Are you getting errors in the SQL Error Log? If so, could you copy and paste one of these errors into the thread as it may help diagnose the problem?

|||

In general, Significant wait times on page latches is often related to disk issues. You'd generally want to watch your disk counters in Perf Mon.

But what about your log during this process - is it large enough to handle the load? What is 10% growth - meaning, what size is it trying to grow to if this is the problem. I generally don't have grow logs by a percent - you have no control over what size increments it's growing. If it's a large file you are trying to load, you would also want to try batching the inserts.

-Sue

Latching Errors

Hi all,

We are trying to load a batch in a huge table ( 150 GB) , but sometimes we are getting timeout errors .

When i see in activity monitor, i can see some entries like PAGEIOLATCH_EX, PAGEIOLATCH_SH.

Can somebody suggets me the workaround for this problem.

Thanks for all your help.

Configuration:

Sql Server 2005 SP1, 4GB Memory, Windows 2003 standard Edition SP1

Could you post an example of the error you are getting?

Can you check what level of growth is specified for you data/log files please? eg 10% or 100MB....
|||

Hi Rich,

Growth for the data file = 2000 MB , Unrestricted Growth. and log file = 10% Unrestricted growth.

And about error, when i see in the activity monitor , i can see PAGEIOLATCH_EX, PAGEIOLATCH_SH, in the wait type column. ( its taking a long time, for rolling back the batch)

Is there anything about indexes , which affects this kind of error.

Thanks.

|||

Are you getting errors in the SQL Error Log? If so, could you copy and paste one of these errors into the thread as it may help diagnose the problem?

|||

In general, Significant wait times on page latches is often related to disk issues. You'd generally want to watch your disk counters in Perf Mon.

But what about your log during this process - is it large enough to handle the load? What is 10% growth - meaning, what size is it trying to grow to if this is the problem. I generally don't have grow logs by a percent - you have no control over what size increments it's growing. If it's a large file you are trying to load, you would also want to try batching the inserts.

-Sue

Friday, March 9, 2012

large union query

Hi there
I have a large union query that produces a "timeout expired" error. I've
changed the timeout settings to 600 seconds but I still get the message.
My query and underlying database are characterized as follows:
a) two fairly large database tables (1.5m and 0.7m rows respectively)
b) a "SELECT DISTINCT" query for each table joined by a "UNION" statement
c) a couple of "LIKE '%this%'" clauses in each SELECT statement
The query should return around 7-8000 rows.
Are there any guidelines, either as to the maximum feasible size of such a
query, or as to an alternative method to achieve the same thing?
Best regards
Loane
Hi
LIKE '%this%'" results in a table scan as it can not use an index. Is there
any other column that is not using a like that could reduce the number of
rows SQL Server would need to process?
Scanning 2.2m rows can take long. How long does it take in query analyzer?
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/
"Loane Sharp" <look_sharp@.hotmail.com> wrote in message
news:eMVuDw$KFHA.2716@.TK2MSFTNGP15.phx.gbl...
> Hi there
> I have a large union query that produces a "timeout expired" error. I've
> changed the timeout settings to 600 seconds but I still get the message.
> My query and underlying database are characterized as follows:
> a) two fairly large database tables (1.5m and 0.7m rows respectively)
> b) a "SELECT DISTINCT" query for each table joined by a "UNION" statement
> c) a couple of "LIKE '%this%'" clauses in each SELECT statement
> The query should return around 7-8000 rows.
> Are there any guidelines, either as to the maximum feasible size of such a
> query, or as to an alternative method to achieve the same thing?
> Best regards
> Loane
>
|||Hi Mike
Thanks for this ... I'm pretty much self-taught on SQL Server and generally
prefer to use T-SQL from the SQL pane, which no doubt this causes all sorts
of problems. Moreover, I'm not a DBA (actually an economist/statistician
type) so my use of SQL Server is probably not the one for which it was
designed. But it is a bit worrying to me that changing the timeout settings
to 10 minutes (Tools>Options>Advanced...) doesn't make an impact on a large
or complex query, which still returns a timeout error after 4 or 5 seconds.
I haven't used Query Analyser much and will check this out.
Best regards
Loane
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:%23SHhklALFHA.732@.TK2MSFTNGP12.phx.gbl...
> Hi
> LIKE '%this%'" results in a table scan as it can not use an index. Is
> there
> any other column that is not using a like that could reduce the number of
> rows SQL Server would need to process?
> Scanning 2.2m rows can take long. How long does it take in query analyzer?
> 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/
> "Loane Sharp" <look_sharp@.hotmail.com> wrote in message
> news:eMVuDw$KFHA.2716@.TK2MSFTNGP15.phx.gbl...
>

large union query

Hi there
I have a large union query that produces a "timeout expired" error. I've
changed the timeout settings to 600 seconds but I still get the message.
My query and underlying database are characterized as follows:
a) two fairly large database tables (1.5m and 0.7m rows respectively)
b) a "SELECT DISTINCT" query for each table joined by a "UNION" statement
c) a couple of "LIKE '%this%'" clauses in each SELECT statement
The query should return around 7-8000 rows.
Are there any guidelines, either as to the maximum feasible size of such a
query, or as to an alternative method to achieve the same thing?
Best regards
LoaneHi
LIKE '%this%'" results in a table scan as it can not use an index. Is there
any other column that is not using a like that could reduce the number of
rows SQL Server would need to process?
Scanning 2.2m rows can take long. How long does it take in query analyzer?
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/
"Loane Sharp" <look_sharp@.hotmail.com> wrote in message
news:eMVuDw$KFHA.2716@.TK2MSFTNGP15.phx.gbl...
> Hi there
> I have a large union query that produces a "timeout expired" error. I've
> changed the timeout settings to 600 seconds but I still get the message.
> My query and underlying database are characterized as follows:
> a) two fairly large database tables (1.5m and 0.7m rows respectively)
> b) a "SELECT DISTINCT" query for each table joined by a "UNION" statement
> c) a couple of "LIKE '%this%'" clauses in each SELECT statement
> The query should return around 7-8000 rows.
> Are there any guidelines, either as to the maximum feasible size of such a
> query, or as to an alternative method to achieve the same thing?
> Best regards
> Loane
>|||Hi Mike
Thanks for this ... I'm pretty much self-taught on SQL Server and generally
prefer to use T-SQL from the SQL pane, which no doubt this causes all sorts
of problems. Moreover, I'm not a DBA (actually an economist/statistician
type) so my use of SQL Server is probably not the one for which it was
designed. But it is a bit worrying to me that changing the timeout settings
to 10 minutes (Tools>Options>Advanced...) doesn't make an impact on a large
or complex query, which still returns a timeout error after 4 or 5 seconds.
I haven't used Query Analyser much and will check this out.
Best regards
Loane
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:%23SHhklALFHA.732@.TK2MSFTNGP12.phx.gbl...
> Hi
> LIKE '%this%'" results in a table scan as it can not use an index. Is
> there
> any other column that is not using a like that could reduce the number of
> rows SQL Server would need to process?
> Scanning 2.2m rows can take long. How long does it take in query analyzer?
> 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/
> "Loane Sharp" <look_sharp@.hotmail.com> wrote in message
> news:eMVuDw$KFHA.2716@.TK2MSFTNGP15.phx.gbl...
>