473,326 Members | 2,655 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to handle a long time executing SQL Query ?

I'm having a SQL Query which runs for nearly 30 mins.

Solution Which I Tried
--------------------------
1) I have tried using ROW_NUMBER() still its not getting fast

Kindly provide me the solution for make it fast. Also I'm attaching the query for your reference.
Attached Files
File Type: txt Query1.txt (10.0 KB, 266 views)
Nov 18 '13 #1
1 1133
ck9663
2,878 Expert 2GB
Your subqueries on your PR_EmployeeLogs is what's killing it. Try to rewrite it differently.

Also, make sure you have all the necessary index on your tables.

Good Luck!!!


~~ CK
Nov 18 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: JGH | last post by:
I want to create a web page that allows a user to run an oracle stored procedure. That's easy enough but the problem is that the procedure might take several seconds to complete. I don't want...
1
by: Robin Becker | last post by:
I'm trying to get a handle on a real world problem related to raising an exception. This is in the reportlab SimpleDoctemplate class. The following code takes a very long time (>60 seconds) in...
4
by: Karaoke Prince | last post by:
Hi There, I have an update statement to update a field of a table (~15,000,000 records). It took me around 3 hours to finish 2 weeks ago. After that no one touched the server and no...
1
by: john.livermore | last post by:
When I login using QA to my SQL Server database, it takes 15-20 seconds to establish a connection and open a query window. Drilling into a database via Enterprise Manager is similar. Once the...
5
by: Javier | last post by:
I have a field type Date/Time that automatically defaults to Now(). I'm having a problem writing a query that will retrieve all the records for a specific date the user to enters when prompted. I...
3
by: Kristen | last post by:
I need to query an Access database via VB and get a count of all the calls where the start time is between a 2 certain days/times. For example, all the calls that occurred from Saturday @ 8am to...
7
by: Ed McNierney | last post by:
I'm trying to use ServerXMLHTTP on an ASP (not ASP.NET) page to retrieve large binary data from a remote server. When the request is large (more than a few megabytes), the ServerXMLHTTP page jumps...
1
by: hlnet | last post by:
Hi michaelb, Hel me please. 1.I have table "Master" with fields : Id,description,HD8,Hd6,name. How to create FUNCTION for executing query : SELECT Id,description FROM Master ( only 2...
1
by: Hennie7863 | last post by:
Hi, I've a strange problem with a INSERT query. It's taking a long time to execute. The format is like this : INSERT INTO table1 SELECT .. FROM table2 Executing the SELECT .. FROM table2 is...
3
by: camarun20 | last post by:
Hi , I constructed an MS access query in java to retrieve the rows in random. The code snipet Connection con = DriverManager.getConnection( database ,"",""); Statement s =...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.