473,396 Members | 1,891 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,396 software developers and data experts.

Can I JOIN without sorting?

8,435 Expert 8TB
Hi all.

Is there any way to create a JOIN without sorting on the joined field?

I'm sure I have asked something similar before, but can't seem to find it by searching TSDN. I have a big table, records stored in date/time sequence. To save space I pulled some repetitive text out to a lookup table, and "inner joined" them in a query to get the equivalent of the original table. But this introduced two problems.
  • The query is returned sorted by the join field, while I still want them in date/time order.
  • Sorting the millions of records takes too long.
Adding an ORDER BY clause is not really an option, as it then takes even longer. In fact I have had Access "order bying" the query as I typed this message, and it's still going. That is WAY too long for a response to a user query.
Feb 6 '07 #1
8 1803
MMcCarthy
14,534 Expert Mod 8TB
Truthfully, I haven't a clue. :D Very helpful I know. Ade is probably better at this kind of thing than me.

Mary
Feb 6 '07 #2
NeoPa
32,556 Expert Mod 16PB
This is not something you can specify explicitly.
It is managed by the SQL engine optimisation logic.
Clearly, for the engine to process through two recordsets JOINed on a particular field or fields, it will need (at the very least prefer) for both recordsets to be sorted on that field.
I can't think of a way even to trick it into doing it any different way, I'm afraid.
I'm sure that if you tried to implement the logic in DAO recordsets in VB you would find yourself limited in the same way.
Feb 6 '07 #3
nico5038
3,080 Expert 2GB
Hmm, interesting problem :-)
Did you try a:

select * from tblX a, tblY b
where a.ID = b.ID

to see or that gives the same effect ?

Nic;o)
Feb 7 '07 #4
Killer42
8,435 Expert 8TB
Hmm, interesting problem :-)
Did you try a:

select * from tblX a, tblY b
where a.ID = b.ID

to see or that gives the same effect ?
Thanks for the idea, I'll give it a try.

It's not really a huge problem, just very annoying ("If I wanted them sorted that way, I would have said so").
Feb 7 '07 #5
nico5038
3,080 Expert 2GB
For the query execution you might check the ShowPlan JET engine:
http://support.microsoft.com/default...;en-us;Q162701

Nic;o)
Feb 7 '07 #6
Killer42
8,435 Expert 8TB
For the query execution you might check the ShowPlan JET engine:
http://support.microsoft.com/default...;en-us;Q162701
Thanks again, nico. I will definitely have a look at this. Would be doing so now if it weren't for the fact that it's an EXE and therefore blocked. :(

Will have to download it tonight at home.
Feb 7 '07 #7
nico5038
3,080 Expert 2GB
Try:
http://www.altict.nl/Backups/Showplan.zip

Nic;o)
Feb 7 '07 #8
Killer42
8,435 Expert 8TB
Try:
http://www.altict.nl/Backups/Showplan.zip
Nope, still blocked. Apparently zip files are dangerous. :(

Never mind, I'll download it tonight. There's no real rush, anyway.
Feb 8 '07 #9

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

Similar topics

4
by: jason | last post by:
Hello. Newbie on SQL and suffering through this. I have two tables created as such: drop table table1; go drop table table2; go
4
by: Yonatan Maman | last post by:
Hi Im using access 2000. and I have a strange problem. when I execute a query on TABLE_A (TABLE_A contains 2 colums: "id" INTEGER and "name" MEMO) Query1: "select id, name from TABLE_A ORDER BY...
6
by: davegb | last post by:
I'm trying to create a self-join table to show the relationship between employee and supervisor. In another thread, I was advised to create a SupervisorID in the employee table, a separate...
0
by: Vendell | last post by:
Join one of Canada's finest business men... Dear entrepreneur colleague: Here is a message from the founder.... Let me introduce myself. My name is Ariel Topf. I am 42 years old and I have...
9
by: Fish Womper | last post by:
I am at best a part time developer of Access databases. I use Access 2.0, as this is all my employer has on its computers. Even so, to use this ancient version requires a fairly convoluted...
4
by: Brian Parker | last post by:
I'm new to ms-sqlserver ( 2000 ) and need to get an OUTER JOIN working on a three table query. Assumptions: -- I have events in the Event table. -- Each event CAN have one Transaction, but it's...
52
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible...
1
by: Racerx | last post by:
Hi All, I use db2 v8.1 on AIX 5L Evrytikme I take a snapshot for one my databases I can see that there are Hash join overflows and small hash join overflows.. Jus need to know what shud i...
1
by: Vivienne | last post by:
Hi there This is a hard problem that I have - I have only been using sql for a couple of weeks and have gone past my ability level quickly! The real tables are complex but I will post a simple...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
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...

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.