473,651 Members | 2,937 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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,15 9176,10969,1591 53,159141,15913 3,101609,159141 ,
141411,159168,1 38575,155954,15 9175,159143,165 5,159167,159161 ,159166,159134, 1
49541,159173,38 90,135155,1,159 174,159155,3413 ,5196,159156,19 0570,159151,159 1
47,1115,43653,6 3875,165350,159 169,159165,1101 1,9651,43308,13 904,159170,1498 6
8,93,111034,873 ,43647,155478,5 1116,159171,159 148,4711,71736, 159137,80033,43 0
67,1110,493,393 1,8736,159138,1 59171,9561,4783 1,159177,43651, 194688,1194,886 8
3,116337,159158 ,43654,171813,1 59117,106853,16 5348,159131,159 178,111133,1591 6
0,159130,159140 ,159145,8171,15 9180,15174,1591 51,13717,1079,1 59179,17,1900,1 5
9146,159118,159 139,80036,15904 6,46166,104775, 159115,159183,4 3711,106918,159 1
61,86363,188159 ,159150,159131, 159159,43657,15 9181,159163,159 149,5311,91317, 8
1140,9746,80037 ,163163,90,19,1 59157,43655,159 119,11111,91,15 9154,159181,110 6
3,15175,91,1591 36,49095,10,159 164) AND TableA.id = TableB.id AND TableA.CID
= TableC.CID GROUP BY TableA.id , TableA.score, Name,CName
Jul 20 '05 #1
0 1457

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

Similar topics

9
2231
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 something, I'd appreciate it. I'm trying to update my website, and I created about eight pages of html code on a Mac, using Simple Text. I viewed all pages locally on my Mac using Netscape, and they looked fine.
44
12702
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 advance, Rita
12
1415
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 mind to make it inline. However, the function is invoked only once, and its invokation is at the very beginning of the
2
1460
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
2510
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 windows machine it works well, on Solaris not. The windows and solaris path into c language is the same. I'd like to say also that real value works correctly also if they are
3
1179
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 long, and I would like to display it in two or three columns (side by side). What would be the best way to accomplish this? Help! Thanks
3
29691
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 -O3. I don't see any reason why optimization should change things much in this piece of code - there's no way to optimize it out and I have verified that this particular line does what it should no matter how the program is compiled. Anyway,...
9
2983
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 SELECT HCRecon.*,EMP_MASTER.EMP_ID as WFM_EMPID, EMP_MASTER.EMP_NAME as WFM_EMPNAME,EMP_MASTER.TL_ID as WFM_SUPID, EMP_MASTER.TL_NAME as WFM_SUPNAME,emp_master.designation as WFM_DESIG,emp_master.function as...
2
9833
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 to open in datasheet view. As an experiment, I deleted all rows in all tables; after that, the query took only seconds to open in both design view and datasheet view. From these facts, I conclude that Access is evaluating the query when I go to...
0
8357
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8803
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8581
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7298
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4285
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2701
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1910
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1588
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.