1d151 Northwind Mystery
Sign Up |  Live StatsLive Stats    Articles 37,330| Comments 177,266| Members 19,414, Newest foundloveandlost| Online 451
Home Contact
 (Forgotten?): 
    Sikhism
    For best SPN experience, use Firefox Internet Browser!


                                                                   Your Banner Here!    




Click Here to Register/Sign Up Daily Hukamnama Member Blogs Downloads Website Navigation Help Fonts Tags

Northwind Mystery

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 500 USD, Received: 115 USD (23%)
Please Donate...
     
Related Topics...
Thread Thread Starter Forum Replies Last Post
What is the Greatest Mystery? spnadmin Judaism 3 19-Jul-2011 13:30 PM
Northwind database - Customer Phone list Ed Information Technology 1 28-Jul-2006 08:12 AM
re: Northwind Mystery Nugimac Information Technology 10 28-Jul-2006 08:04 AM
Northwind as an example Tom Ellison Information Technology 8 28-Jul-2006 08:03 AM
Northwind DB instructions Bob Richardson Information Technology 1 11-Nov-2005 20:08 PM


Tags
northwind, mystery
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 28-Jul-2006, 08:02 AM
Tom Ellison's Avatar Tom Ellison
Guest
 
Posts: n/a
   
   
Northwind Mystery

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
In the Northwind database, there are several indexes for which I do not
understand the purpose.

Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/9472-northwind-mystery.html
In the Products table, there are indexes on CategoryID and SupplierID. For
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9472
what purpose are these created? I haven't seen anywhere they are used. If
there is a reason for them, I'd like to know.

These are indexes of surrogate key values that are the autonumbers in other
tables.

Thanks.

Tom Ellison



*







Got anything to share on This Topic? Why not share your immediate thoughts/reaction with us! Login Now! or Sign Up Today! to share your views... Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 28-Jul-2006, 08:02 AM
Norman Yuan's Avatar Norman Yuan
Guest
 
Posts: n/a
   
   
Re: Northwind Mystery

Those fields (CategoryID, SupplierID) are the foreign keys, which, along
with primary keys, are used to establish relationships between tables.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9472
Primary/foriegn key is a very basic concept of relational database. One must
understand these basic things in order to do some meaningful work with
relational database system.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9472

"Tom Ellison" wrote in message
news:uyaZi5UdGHA.1656@TK2MSFTNGP02.phx.gbl...
> In the Northwind database, there are several indexes for which I do not
> understand the purpose.
>
> In the Products table, there are indexes on CategoryID and SupplierID.
> For what purpose are these created? I haven't seen anywhere they are
> used. If there is a reason for them, I'd like to know.
>
> These are indexes of surrogate key values that are the autonumbers in
> other tables.
>
> Thanks.
>
> Tom Ellison
>
>



Reply With Quote
  #3 (permalink)  
Old 28-Jul-2006, 08:02 AM
Tom Ellison's Avatar Tom Ellison
Guest
 
Posts: n/a
   
   
Re: Northwind Mystery

Dear Norman:

OK. I won't recite my credentials, but I'm a senior developer, and I'm
extremely familiar with these concepts. There MUST be a unique index on the
column(s) of a relationship on the ONE side of the relationship. But why
index them on the MANY side of the relationship? They certainly aren't
unique there!

I have generally not seen an index on the related columns placed in the
table on the MANY side!

I suppose my question presumes some familiarity with this common database
example.

Thanks for offering your suggestion, Norman!

Tom Ellison


"Norman Yuan" wrote in message
news:OzQ0wbVdGHA.1204@TK2MSFTNGP02.phx.gbl...
> Those fields (CategoryID, SupplierID) are the foreign keys, which, along
> with primary keys, are used to establish relationships between tables.
> Primary/foriegn key is a very basic concept of relational database. One
> must understand these basic things in order to do some meaningful work
> with relational database system.
>
> "Tom Ellison" wrote in message
> news:uyaZi5UdGHA.1656@TK2MSFTNGP02.phx.gbl...
>> In the Northwind database, there are several indexes for which I do not
>> understand the purpose.
>>
>> In the Products table, there are indexes on CategoryID and SupplierID.
>> For what purpose are these created? I haven't seen anywhere they are
>> used. If there is a reason for them, I'd like to know.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9472
>>
>> These are indexes of surrogate key values that are the autonumbers in
>> other tables.
>>
>> Thanks.
>>
>> Tom Ellison
>>
>>

Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9472
>
>



Reply With Quote
  #4 (permalink)  
Old 28-Jul-2006, 08:02 AM
John Vinson's Avatar John Vinson
Guest
 
Posts: n/a
   
   
Re: Northwind Mystery

On Thu, 11 May 2006 1713 -0500, "Tom Ellison"
wrote:

>In the Products table, there are indexes on CategoryID and SupplierID. For
>what purpose are these created? I haven't seen anywhere they are used. If
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9472
>there is a reason for them, I'd like to know.
>
>These are indexes of surrogate key values that are the autonumbers in other
>tables.


They're not "surrogate" key values - they are foreign keys. For
example, there is an enforced Relationship defined between the primary
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9472
key of Categories and the corresponding foreign key CategoryID in the
Products table; the way that Access enforces this relationship is...
tadaa!... with an Index.

John W. Vinson[MVP]
Reply With Quote
  #5 (permalink)  
Old 28-Jul-2006, 08:02 AM
Tom Ellison's Avatar Tom Ellison
Guest
 
Posts: n/a
   
   
Re: Northwind Mystery

Dear John:

An autonumber used for a relationship between two tables is certainly what
I'd call a surrogate key. If you have another definition, I'd be glad to
here it. But that's not the point here.

The question is, why would there be an index on the CategoryID column in the
Products table, that is, in the table on the MANY side of the relationshkp.
I know there must be a unique index on the key column on the ONE side of the
relationship. I have created many one-to-many relationships, but having an
index on the key column on the MANY side has never been needed. Don't you
concur?

Which brings me back to the question. Why index the CategoryID and the
SupplierID in the table on the MANY side of the relationshkp, the Products
table?

Thanks.

Tom Ellison


"John Vinson" wrote in message
news:7rl762do6j7oc7vbinbrp1anjj93nud70a@4ax.com...
> On Thu, 11 May 2006 1713 -0500, "Tom Ellison"
> wrote:
>
>>In the Products table, there are indexes on CategoryID and SupplierID.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9472
>>For
>>what purpose are these created? I haven't seen anywhere they are used.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9472
>>If
>>there is a reason for them, I'd like to know.
>>
>>These are indexes of surrogate key values that are the autonumbers in
>>other
>>tables.

>
> They're not "surrogate" key values - they are foreign keys. For
> example, there is an enforced Relationship defined between the primary
> key of Categories and the corresponding foreign key CategoryID in the
> Products table; the way that Access enforces this relationship is...
> tadaa!... with an Index.
>
> John W. Vinson[MVP]



Reply With Quote
  #6 (permalink)  
Old 28-Jul-2006, 08:02 AM
Albert D.Kallal's Avatar Albert D.Kallal
Guest
 
Posts: n/a
   
   
Re: Northwind Mystery

"Tom Ellison" wrote in message
news:uyaZi5UdGHA.1656@TK2MSFTNGP02.phx.gbl...
> In the Northwind database, there are several indexes for which I do not
> understand the purpose.
>
> In the Products table, there are indexes on CategoryID and SupplierID.
> For what purpose are these created? I haven't seen anywhere they are
> used. If there is a reason for them, I'd like to know.


Well, you are correct, they are not really needed, and the database will
function without them.

However, if you plan run any report based on products, and want to select
(filter) only particular products of a given category, then a index would
make a very large difference in performance. The same idea applies to the
CatagryID.

If I filter, or want to find a particular product by catagoryID, then a
index would again make a VERY large difference in performance.

As a side note, any time you create a field name of number type, and the
field name ends with "ID" , ms-access will default to indexing that column
(so, actually, you have to be careful to not accident create indexes when
you don't need them!)

I have to say for the most part, that indexing these types of "catgalogry"
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9472
fields is a very good idea from a performance point of view.

So, likely, they are there because when you enter field names that end in
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9472
id...ms-access will automatic default to indexed (so, perhaps someone did
nothing here (lazy), .and just let ms-access default to having a index).

However, from a sorting, or selecting point of view...having a index here
will make a large difference in performance....


--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com
http://www.members.shaw.ca/AlbertKallal


Reply With Quote
  #7 (permalink)  
Old 28-Jul-2006, 08:02 AM
Tom Ellison's Avatar Tom Ellison
Guest
 
Posts: n/a
   
   
Re: Northwind Mystery

Dear Albert:

Now, that's some good stuff! Thanks!
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9472

I certainly didn't know Access would create indexes based on column names.
That seems weird indeed. But it probably explains why these indexes are
there. Whoever built Northwind may not have known there were there.

Isn't it true that having extra indexes can also be a bad thing? It takes
time to change the index whenever a new row is added, a row is deleted, or
when the subject column is updated. This is NOT so good for performance.

Your suggestion that this column might well be filtered in a query or form
is quite reasonable. The amount of performance gained with an index would
depend on what proportion of the table is filtered. If a filter includes
80% of the table, then a table scan is not so inefficient - you're going to
have to read 80% of the rows anyway. If the filter includes 1% of the
table, an index could be a big boost. Makes sense here.

To put this into Northwind without any explanation doesn't tend to serve the
rationale behind Northwind, to teach and give examples. I could not learn
this from Northwind, but fortunately there is Albert.

Now, the question is, are these indexes used somewhere in Northwind,
justifying their existence? Well, you might come along and filter by just
about any column in the database, right? So, let's start out with all the
columns indexed, just for good measure. Somehow, that's the impression I'm
getting here. Not really a good idea.

I'll be sure none of my numeric columns ends in ID. That's for sure. I
like to control the design of my tables, not have it taken from me.

Tom Ellison


"Albert D.Kallal" wrote in message
news:urVU89VdGHA.2188@TK2MSFTNGP05.phx.gbl...
> "Tom Ellison" wrote in message
> news:uyaZi5UdGHA.1656@TK2MSFTNGP02.phx.gbl...
>> In the Northwind database, there are several indexes for which I do not
>> understand the purpose.
>>
>> In the Products table, there are indexes on CategoryID and SupplierID.
>> For what purpose are these created? I haven't seen anywhere they are
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9472
>> used. If there is a reason for them, I'd like to know.

>
> Well, you are correct, they are not really needed, and the database will
> function without them.
>
> However, if you plan run any report based on products, and want to select
> (filter) only particular products of a given category, then a index would
> make a very large difference in performance. The same idea applies to the
> CatagryID.
>
> If I filter, or want to find a particular product by catagoryID, then a
> index would again make a VERY large difference in performance.
>
> As a side note, any time you create a field name of number type, and the
> field name ends with "ID" , ms-access will default to indexing that
> column (so, actually, you have to be careful to not accident create
> indexes when you don't need them!)
>
> I have to say for the most part, that indexing these types of "catgalogry"
> fields is a very good idea from a performance point of view.
>
> So, likely, they are there because when you enter field names that end in
> id...ms-access will automatic default to indexed (so, perhaps someone did
> nothing here (lazy), .and just let ms-access default to having a index).
>
> However, from a sorting, or selecting point of view...having a index here
> will make a large difference in performance....
>
>
> --
> Albert D. Kallal (Access MVP)
> Edmonton, Alberta Canada
> pleaseNOOSpamKallal@msn.com
> http://www.members.shaw.ca/AlbertKallal
>
>



Reply With Quote
  #8 (permalink)  
Old 28-Jul-2006, 08:02 AM
Arvin Meyer [MVP]'s Avatar Arvin Meyer [MVP]
Guest
 
Posts: n/a
   
   
Re: Northwind Mystery


"Tom Ellison" wrote in message
news:OWIn5LWdGHA.3352@TK2MSFTNGP03.phx.gbl...
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9472
> Dear Albert:
>
> Now, that's some good stuff! Thanks!
>
> I certainly didn't know Access would create indexes based on column names.
> That seems weird indeed. But it probably explains why these indexes are
> there. Whoever built Northwind may not have known there were there.
>
> I'll be sure none of my numeric columns ends in ID. That's for sure. I
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9472
> like to control the design of my tables, not have it taken from me.


Hi Tom,

Not just ID, Access automatically indexes fields ending in:

ID; key; code; num

unless you disable this in Options.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access


Reply With Quote
  #9 (permalink)  
Old 28-Jul-2006, 08:02 AM
Jeff Conrad's Avatar Jeff Conrad
Guest
 
Posts: n/a
   
   
Re: Northwind Mystery

  Donate Today!  
Hi Tom,

> I'll be sure none of my numeric columns ends in ID. That's for sure. I like to control the
> design of my tables, not have it taken from me.


If you go to Tools | Options | Tables/Queries
look for the text box called "AutoIndex on Import/Create:"
You'll see the default settings that Access uses to automatically
create indexes without your permission. On a default installation
you can see that Access has four entries in that text box. Any field
names that end with ID, key, code, or num will be "graciously"
indexed automatically for you.

--
Jeff Conrad
Access Junkie - MVP
http://home.bendbroadband.com/conrad...essjunkie.html
http://www.access.qbuilt.com/html/articles.html

"Tom Ellison" wrote in message:
news:OWIn5LWdGHA.3352@TK2MSFTNGP03.phx.gbl...

> Dear Albert:
>
> Now, that's some good stuff! Thanks!
>
> I certainly didn't know Access would create indexes based on column names. That seems weird
> indeed. But it probably explains why these indexes are there. Whoever built Northwind may not
> have known there were there.
>
> Isn't it true that having extra indexes can also be a bad thing? It takes time to change the
> index whenever a new row is added, a row is deleted, or when the subject column is updated. This
> is NOT so good for performance.
>
> Your suggestion that this column might well be filtered in a query or form is quite reasonable.
> The amount of performance gained with an index would depend on what proportion of the table is
> filtered. If a filter includes 80% of the table, then a table scan is not so inefficient - you're
> going to have to read 80% of the rows anyway. If the filter includes 1% of the table, an index
> could be a big boost. Makes sense here.
>
> To put this into Northwind without any explanation doesn't tend to serve the rationale behind
> Northwind, to teach and give examples. I could not learn this from Northwind, but fortunately
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9472
> there is Albert.
>
> Now, the question is, are these indexes used somewhere in Northwind, justifying their existence?
> Well, you might come along and filter by just about any column in the database, right? So, let's
> start out with all the columns indexed, just for good measure. Somehow, that's the impression I'm
> getting here. Not really a good idea.
>
> I'll be sure none of my numeric columns ends in ID. That's for sure. I like to control the
> design of my tables, not have it taken from me.
>
> Tom Ellison
>
>
> "Albert D.Kallal" wrote in message
> news:urVU89VdGHA.2188@TK2MSFTNGP05.phx.gbl...
>> "Tom Ellison" wrote in message
>> news:uyaZi5UdGHA.1656@TK2MSFTNGP02.phx.gbl...
>>> In the Northwind database, there are several indexes for which I do not understand the purpose.
>>>
>>> In the Products table, there are indexes on CategoryID and SupplierID. For what purpose are
>>> these created? I haven't seen anywhere they are used. If there is a reason for them, I'd like
>>> to know.

>>
>> Well, you are correct, they are not really needed, and the database will function without them.
>>
>> However, if you plan run any report based on products, and want to select (filter) only
>> particular products of a given category, then a index would make a very large difference in
>> performance. The same idea applies to the CatagryID.
>>
>> If I filter, or want to find a particular product by catagoryID, then a index would again make a
>> VERY large difference in performance.
>>
>> As a side note, any time you create a field name of number type, and the field name ends with
>> "ID" , ms-access will default to indexing that column (so, actually, you have to be careful to
>> not accident create indexes when you don't need them!)
>>
>> I have to say for the most part, that indexing these types of "catgalogry" fields is a very good
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=9472
>> idea from a performance point of view.
>>
>> So, likely, they are there because when you enter field names that end in id...ms-access will
>> automatic default to indexed (so, perhaps someone did nothing here (lazy), .and just let
>> ms-access default to having a index).
>>
>> However, from a sorting, or selecting point of view...having a index here will make a large
>> difference in performance....
>>
>>
>> --
>> Albert D. Kallal (Access MVP)
>> Edmonton, Alberta Canada
>> pleaseNOOSpamKallal@msn.com
>> http://www.members.shaw.ca/AlbertKallal
>>
>>

>
>



Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Active Discussions
Keeping Amrit Vela
Today 16:49 PM
12 Replies, 899 Views
How does Sikhi help you...
Today 16:16 PM
26 Replies, 913 Views
Do you believe in...
Today 15:08 PM
196 Replies, 4,078 Views
Occultism - Rejection in...
Today 14:04 PM
59 Replies, 2,585 Views
Panjabi
By Ishna
Today 13:43 PM
14 Replies, 282 Views
Black Sikhs?
Today 06:33 AM
20 Replies, 5,795 Views
Man Driving Without...
Today 05:06 AM
5 Replies, 136 Views
Request for assistance...
Today 04:24 AM
8 Replies, 89 Views
Losing My Religion: Why...
Today 03:03 AM
13 Replies, 348 Views
Health Exercise And...
Today 02:10 AM
1 Replies, 90 Views
Sikh Spokesman (ਪੰਜਾਬੀ...
Today 02:10 AM
176 Replies, 4,511 Views
How Religions Change...
Today 02:07 AM
1 Replies, 105 Views
Rozana Reports (ਪੰਜਾਬੀ...
Today 01:52 AM
313 Replies, 7,597 Views
Parkash Guru Amar Das ji...
Yesterday 17:07 PM
3 Replies, 84 Views
Serious challenges to...
Yesterday 16:49 PM
0 Replies, 149 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.3
All times are GMT +6.5. The time now is 16:51 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.57176 seconds with 32 queries
0