Monday, March 19, 2012

Indexing in SQL 2000

Hello Reader

Why I am not seeing the row values as per the index set on the table?
It appears in random manner.

I think it should appear ascending as per the index set for one of the Column in Ascending.

Please guide.

*****************************************
* This message was posted via http://www.sqlmonster.com
*
* Report spam or abuse by clicking the following URL:
* http://www.sqlmonster.com/Uwe/Abuse...73eeefbc3df9e58
*****************************************On Sat, 06 Nov 2004 22:44:24 GMT, SuryaPrakash Patel via SQLMonster.com
wrote:

>Hello Reader
>Why I am not seeing the row values as per the index set on the table?
>It appears in random manner.
>I think it should appear ascending as per the index set for one of the Column in Ascending.

Hi Surya,

The rows will only appear in a specific order if you explicitly request
that order with an ORDER BY clause. Without that, SQL Server is free to
choose any order (and the optimizer will try to choose the order that can
be gotten the quickest).

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)|||Dear Hugo,

Thanks

I am trying to design a database. How can I make best Judgement that Indexing (which I am trying to fix during Diagram Desingning process)is ok.

I am able to identify the best candidate for the indexing.

Below is the details I want to understand:

Area
ZIP
City
County
District
State/Province
Country

Now I want the data retrival optimization through Index. (you can suggest another idea, also)

Entities Area,..., Country have independent tables.
Example:

Area_Table
AreaID (PK)
Area
They have relationship- one to many- if you go from Country to Area.

There is one more table:

Location_Table (PK)
LocationID
AreaID
ZIPID
CityID
CountyID
DistrictID
State/ProvinceID
CountryID
(Location_ID is further related to the Address of the contact.)

GUI has a single form to enter these details.On a save command details in all the tables -Area to Country- (individually) being inserted.
& simultaniously Location_Table is also being inserted with the details.

Following is the situation of being queried these tables:

(1) GUI user can select an Area than the related details of ZIP .., ..., ...upto Country etc. should be loaded automatically (id it is previously stored by the user entry in the database.)

(2) Contacts have to retrived on the basis of Area, ZIP, ....County. (Necessary Groupings are required )

Example:
If Contacts are queried State Wise then the Display should be

State1
District1
County1
City1
ZIP1
Area1
Area2
ZIP2
City2

County2
District2

Please Guide.

SuryaPrakash

*****************************************
* A copy of the whole thread can be found at:
* http://www.sqlmonster.com/Uwe/Forum...sql-server/5074
*
* Report spam or abuse by clicking the following URL:
* http://www.sqlmonster.com/Uwe/Abuse...b0a1ca5be7a0133
*****************************************

No comments:

Post a Comment