473,800 Members | 2,640 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pre-sroted table (w/ index)

In TransacSQL, we used to have the tabled sorted by marking an index for
example by create_date.

This way we did not need to do an order by or at least it was faster.

Is there a way to force the table to be physicaly stroed sorted by a
certain index?

tia,
..V
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #1
1 1222
On Thu, Oct 07, 2004 at 11:30:37AM -0500, Vic Cekvenich wrote:
In TransacSQL, we used to have the tabled sorted by marking an index for
example by create_date.

This way we did not need to do an order by or at least it was faster.
You'll always need to do an order by, as there's no guarantee of the
order of the results received. It may work today, but it may not tomorrow.
Is there a way to force the table to be physicaly stroed sorted by a
certain index?


Look in the manual for the SQL command 'CLUSTER'. It doesn't keep a
table ordered on disk as new inserts happen (it's very inefficient to
do so) but it'll order the existing data, which will often speed up
queries that return quite a lot of data from an index scan.

Cheers,
Steve

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #2

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

Similar topics

4
2951
by: New MSSQL DBA | last post by:
I've just found a blocking lock occuring in a SQL Server. >From the waitresource, I found that the blocker has the following information: wait_info: PAGEIOLATCH_EX wait_resource: 14:1:564312 And the blockee has the following information: wait_info: LCK_M_S wait_resource: KEY: 14:405576483:2 (7501a5aa8355)
14
5423
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB 7.2 environment, the choices the optimizer makes often seem flaky. But this last example really floored me. I was hoping someone could explain why I get worse response time when the optimizer uses two indexes, than when it uses one. Some context:
10
6414
by: Jean | last post by:
Hi, how to know for a particular table if it is organized by index, and which one ? reorg table index ind1 -> the table is organised by ind1 i wan't to know that for all table thx
2
8322
by: TomHorner | last post by:
I have several quick questions about reorg's, and a request (favor). 1. The documentation says that reorg "Reorganizes an index or a table" I cannot see how one would reorg ONE particular index - is there a way to do this? More importantly, would you WANT to do this? 2. We plan on doing inplace reorg's due to the 24x7 nature of our database servers. Are there any "undocumented" issues with these for V8.1, FP2 or FP6?
3
1732
by: lauren quantrell | last post by:
In a table design, properties window there is the Indexes/Keys tab. I want to create a few indexes. Row myID is the PK. I also want indexes on rows myOne, myTwo, myThree. In the selected index window: PK_tblName I see myID. Do I put myOne, myTwo, myThree under that in the same index or do I create three new indexes for the table?
1
1097
by: Chris | last post by:
I have a remote database with two table A & B. A contains 100 or so columns and anywhere from 21-50k records. B has 5 columns and anywhere from 100-200k records. B has a many to one relationship with A. I need to process all of these records one by one. What I'm doing right now is pulling down all of table A and then as I process each record doing another call to pull down the many records out of B. What I'd like to do is pull down...
3
1792
by: Bishman | last post by:
Hi, Simple question.... I think.... How can I establish the TableRow index that a particular DataGridViewRow is bound to ? Thanks Jon
4
2265
by: Michael R | last post by:
Or is it not necessary to have that option on the related table field, as the primary table indexed field does that job? And is it a necessity to have the related table field to be indexed if I need distinct values only on that field in case there's a referential integrity between the primary and the related table, and in case there isn't one? Thanks a bunch.
2
9007
fahimghauri
by: fahimghauri | last post by:
Hi all, I DB2 v8.1 FixPack 15 on Linux. I have a table which has over 6 Million rows When I query that table it takes too much time even if I query for first 10 rows only. It also gives error "Log File has reached its saturation point", and ADM5543E Index rebuild of indexes on table. Some times it crashes the database manager. Please help how can I manage that table efficiently??? and why the database manager crashes??? Sincerely,
1
1390
by: aorangi | last post by:
Hi, I want to build in php the type of left hand colonne (I don't know what is call) you find on most web site with a art of tabe contain where you can navigate through the site. Know someone (the name of that colon) and where I can find informations on how to build it. like that +Country and you press + and you get the list of the country etc
0
9690
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
10501
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...
1
10250
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9085
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...
1
7574
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
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...
1
4149
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
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.