Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1058271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:00:04+00:00 2026-05-16T18:00:04+00:00

I have a query that is taking a lot longer then usual, and I

  • 0

I have a query that is taking a lot longer then usual, and I cannot tell if it is stuck.

The query is something like this:

INSERT XXXXXX WITH (TABLOCK)
SELECT * FROM YYYYYY with (NOLOCK)
WHERE ZZZZZZZZ = 1

This will insert hundreds of millions of rows. I have an index on ZZZZZZZZ.

There are no blocking sessions. When I check sys.dm_exec_requests, it shows that the last wait type is PAGEIOLATCH_SH I’m not sure what this means, except that it has something to do with I/O.

sys.dm_exec_sessions shows the status is RUNNING, but sp_who2 shows it as SUSPENDED.

I tried to see if the table is growing, but when I call sp_spaceused XXXXXX, I keep getting the same values.

What else can I do?

UPDATE:

With the help of the answers below, I have found that there is an I/O issue, and that my query is resulting in an average of about 600 records being inserted per minute).

What is my next step?

What can I do before I start to assume that my disk is going bad?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T18:00:05+00:00Added an answer on May 16, 2026 at 6:00 pm

    If you try the following

    select * from sys.dm_os_waiting_tasks
    

    does the resource address it’s waiting on change at all?

    select * 
    into #t1
    from sys.dm_os_wait_stats
    
    waitfor delay '00:01'
    
    select * 
    into #t2
    from sys.dm_os_wait_stats
    
    SELECT #t2.wait_type, 
    #t2.waiting_tasks_count - #t1.waiting_tasks_count as waiting_tasks_count, 
    #t2.wait_time_ms- #t1.wait_time_ms as wait_time_ms, 
    #t2.signal_wait_time_ms- #t1.signal_wait_time_ms as signal_wait_time_ms
    FROM #t2  JOIN #t1 ON #t2.wait_type = #t1.wait_type
    where #t2.wait_type not in ('CHECKPOINT_QUEUE','CHKPT','FT_IFTS_SCHEDULER_IDLE_WAIT',
    'KSOURCE_WAKEUP',
    'LAZYWRITER_SLEEP',
    'LOGMGR_QUEUE',
    'REQUEST_FOR_DEADLOCK_SEARCH',
    'SQLTRACE_BUFFER_FLUSH' ,
    'XE_DISPATCHER_WAIT',
    'XE_TIMER_EVENT', 'WAITFOR')
    order by wait_time_ms desc       
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this query that, due to the number of records, is taking several
I have a query that creates a result set like this: Rank Name 1
I have a query that looks like this SELECT * from myTable WHERE Date
I have this query that is taking information from two different databases: I'm using
I have a SQL query running using something like this: PreparedStatement pstmt = dbConn.prepareStatement(sqlQuery);
We have a query that's taking 3 hours to finish. This wasn't a problem
I have a query that I am executing in C# that is taking way
I have have this query that i want to execute. SELECT warehouse.expiry_date, pharmacy.expiry_date, drugs.active_substance,
I have this query that returns the results by ordering it by focus.name ASC.
We have a query that is taking around 5 sec on our production system,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.