473,406 Members | 2,954 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,406 software developers and data experts.

How to break a long query into shorter ones?

The query below is very long, and it takes about 5 seconds to get the
result. Of course I am not happy with the 5 seconds, and I am wondering if I
can get a better speed if I can break it into several shorter queries. In
general, how do you do that? The following query contains only fake
contents(so that no policy will be violated), and it should show what's the
long query I am talking about.

Thank you, Siemel. Not sure why I can't reply to your reply to the "SQL
index problem" thread. I also tried to open the "Index with OR queries"
thread, but it said "Message is no longer available on the server".

SELECT TableA.id , TableA.score, Name, CName FROM TableB, TableA, TableC
WHERE TableA.DID=5153 AND TableA.id IN
(104606,159135,56115,159144,159176,10969,159153,15 9141,159133,101609,159141,
141411,159168,138575,155954,159175,159143,1655,159 167,159161,159166,159134,1
49541,159173,3890,135155,1,159174,159155,3413,5196 ,159156,190570,159151,1591
47,1115,43653,63875,165350,159169,159165,11011,965 1,43308,13904,159170,14986
8,93,111034,873,43647,155478,51116,159171,159148,4 711,71736,159137,80033,430
67,1110,493,3931,8736,159138,159171,9561,47831,159 177,43651,194688,1194,8868
3,116337,159158,43654,171813,159117,106853,165348, 159131,159178,111133,15916
0,159130,159140,159145,8171,159180,15174,159151,13 717,1079,159179,17,1900,15
9146,159118,159139,80036,159046,46166,104775,15911 5,159183,43711,106918,1591
61,86363,188159,159150,159131,159159,43657,159181, 159163,159149,5311,91317,8
1140,9746,80037,163163,90,19,159157,43655,159119,1 1111,91,159154,159181,1106
3,15175,91,159136,49095,10,159164) AND TableA.id = TableB.id AND TableA.CID
= TableC.CID GROUP BY TableA.id , TableA.score, Name,CName
Jul 20 '05 #1
0 1448

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Melissa | last post by:
Hi, I'm new to the group and haven't had a chance to read the FAQ, but I have a question that's driving me crazy. If anyone here can help me with this or can point me to another site or...
44
by: RB | last post by:
How to extract bytes from long, starting from the last byte? For example, I have a long number: 0x12345678 I need to represent it as the following bytes list: 0x78, 0x56, 0x34, 0x12 Thanks in...
12
by: Tomás | last post by:
The common persuasion is: Big function -- leave it outline. Small function -- make it inline. In code I'm writing at the moment, I have a fairly long function, so it wouldn't cross my...
2
by: junky_fellow | last post by:
Hi, Consider following piece of code: int i = 0x12345678; char c; c = i; printf("0x%x\n",c); What value will be printed ?
28
by: silvia.fama | last post by:
Hi! I'm using c language. I need to copy a long type value into a char string using a memcpy function: memcpy(string, (long *) value, len) this value will be then insert into a database. On...
3
by: trvlDev | last post by:
I am using ASP 2.0 connecting to a SQL database. I retrieve one field of data from one of the tables and return the results to the screen - currently into a DataList. Well, the column is now too...
3
by: David Mathog | last post by:
I have a program for which this line: if(! lstrtol(&atoken,length-2,(long *) &(lclparams->pad)) || (lclparams->pad< 0)){ generates the warning below, but ONLY if the gcc compiler is at -O2 or...
9
by: yaaara | last post by:
Guys, I keep landing into problems (Good for me as I'm learing a lot from this) and here is another one for the brainy ones: I have the following query that I need to execute in Access VBA ...
2
by: existential.philosophy | last post by:
This is a new problem for me: I have some queries that open very slowly in design view. My benchmark query takes about 20 minutes to open in design view. That same query takes about 20 minutes...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.