473,799 Members | 3,080 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

When to use 1:1 relationships?

I have an application with one main table with a jillion attributes.
There are numerous other tables, but these are either children of the
main table or lookup tables.

I am finding that I am using up all my indices on the main table to
support the relationships with all the child and lookup tables.

My question is this: would anyone suggest or caution against the use
of tables that are related to the main table in a 1:1 relationship?

For example, if a number of the fields in the main table have to do
with a like topic, I could move them into their own table. Then, there
could be a 1:1 relationship between the main table and the newly
created table. While this relationship would require an index, a
number of indices would be moved from the main table to the new
ancillary table.

Chuck
Nov 12 '05 #1
6 1957
NO************* ****@sympatico. ca (Chuck Van Den Corput) wrote in
<k0************ *************** *****@4ax.com>:
I have an application with one main table with a jillion
attributes. There are numerous other tables, but these are either
children of the main table or lookup tables.

I am finding that I am using up all my indices on the main table
to support the relationships with all the child and lookup tables.

My question is this: would anyone suggest or caution against the
use of tables that are related to the main table in a 1:1
relationship ?

For example, if a number of the fields in the main table have to
do with a like topic, I could move them into their own table.
Then, there could be a 1:1 relationship between the main table and
the newly created table. While this relationship would require an
index, a number of indices would be moved from the main table to
the new ancillary table.


I've never run up against any index restrictions.

My guess is that you want to break up your main table, but not into
1:1 relationships. My gut tells me that you've probably got a
denormalized structure somewhere in there, which would be the
quickest way to use up indexes (say you have a repeating field,
Field1, Field2, Field2, that is related to a lookup table -- the
clue here is having more than one field pointing to another table).

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 12 '05 #2
>I've never run up against any index restrictions.

My guess is that you want to break up your main table, but not into
1:1 relationships. My gut tells me that you've probably got a
denormalized structure somewhere in there, which would be the
quickest way to use up indexes (say you have a repeating field,
Field1, Field2, Field2, that is related to a lookup table -- the
clue here is having more than one field pointing to another table).


Dave, thanks for your response.

I believe that the table is normalized. I just have an awful lot of
fields, too many I am guessing. I have maxed out on indices due to the
three primary uses of them:
* fields for which I'd like to ensure speedy queries
* numerous fields linked to lookup tables, for the sake of
guaranteeing referential integrity
* several fields linked to child tables

I *do* have instances with multiple fields related to the same lookup
table and would be willing to listen to ways around this. These are
*not* cases where I have been too lazy to introduce a proper 1:N
parent-child relationship (e.g., Patient1ID, Patient2ID, Patient3ID
instead of a 1:N relationship between tblDoctor and tblDoctorPatien t).
Rather, they are more of the flavour PropertyProvinc eID,
LandlordProvinc eID, ManagerProvince ID, etc., all pointing to the same
lookup table, tblProvince.

Chuck
Nov 12 '05 #3
NO************* ****@sympatico. ca (Chuck Van Den Corput) wrote in
<38************ *************** *****@4ax.com>:
I've never run up against any index restrictions.

My guess is that you want to break up your main table, but not
into 1:1 relationships. My gut tells me that you've probably got
a denormalized structure somewhere in there, which would be the
quickest way to use up indexes (say you have a repeating field,
Field1, Field2, Field2, that is related to a lookup table -- the
clue here is having more than one field pointing to another
table).
Dave, thanks for your response.


My name is David.I believe that the table is normalized. I just have an awful lot
of fields, too many I am guessing. I have maxed out on indices due
to the three primary uses of them:
* fields for which I'd like to ensure speedy queries
* numerous fields linked to lookup tables, for the sake of
guaranteeing referential integrity
* several fields linked to child tables
Do you know about the hidden indexes problem? They are created by
establishing relationships. These will show up in the table
documenter. Also, be careful about the auto-indexing of ID fields
(a setting in the options), which can also create unnecessary
indexes. I once reduced a 45MB data file to under 40MBs by
eliminating these duplicate indexes.
I *do* have instances with multiple fields related to the same
lookup table and would be willing to listen to ways around this.
These are *not* cases where I have been too lazy to introduce a
proper 1:N parent-child relationship (e.g., Patient1ID,
Patient2ID, Patient3ID instead of a 1:N relationship between
tblDoctor and tblDoctorPatien t). Rather, they are more of the
flavour PropertyProvinc eID, LandlordProvinc eID, ManagerProvince ID,
etc., all pointing to the same lookup table, tblProvince.


Hmm. Sounds denormalized to me. Why is information about the
landlord and manager stored in the main record? Sounds like a
separate entity that should be stored elsewhere with a link to the
main record. Actually, it's the other way around, the record in the
table you're having trouble with is the child of a landlord, a
manager. Given that a landlord might have multiple properties,
you'd want a N:N join table between the person and property table,
and the provice would be an attribute of the landlord's address,
which could certainly be stored in a separate table. Indeed, you
could take care of both landlord, manager and tenants with a join
table between your property table and your people table, with a
role code in the join. Data in that table could look something like
this:

PropertyID PersonID RoleCode
1 1 Landlord
1 2 Manager
2 1 Landlord
2 3 Tenant

And so forth (probably throwing the tenants into it is a bad idea,
as the relationship between the property and the tenant is very
different from the other relationships).

I've just eliminated at least two fields from your table.

As to indexes to speed up searches, that's tougher. I have found
that the conventional wisdom about indexes not speeding up sparsely
populated fields (i.e., small number of unique values, the classic
example being a Boolean field, which has only 2 possible values)
sufficiently to justify then is simply not as true as I'd like it
to be. I tried eliminating indexes on all fields that had more than
50% nulls and fewer than 10 unique values, and it made selects on
that field significantly slower.

But it's important to consider how often the selection on that
field will happen and whether the added wait of a table scan is
worth it.

But based on your one example, my bet is that your schema needs
work. That's what you asked about in the first place, so it sounds
like you're on the right track.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 12 '05 #4
On Tue, 06 Jan 2004 23:53:53 GMT, dX********@bway .net.invalid (David
W. Fenton) wrote:
NO************ *****@sympatico .ca (Chuck Van Den Corput) wrote in
<38*********** *************** ******@4ax.com> :
I've never run up against any index restrictions.

My guess is that you want to break up your main table, but not
into 1:1 relationships. My gut tells me that you've probably got
a denormalized structure somewhere in there, which would be the
quickest way to use up indexes (say you have a repeating field,
Field1, Field2, Field2, that is related to a lookup table -- the
clue here is having more than one field pointing to another
table).


Dave, thanks for your response.


My name is David.
I believe that the table is normalized. I just have an awful lot
of fields, too many I am guessing. I have maxed out on indices due
to the three primary uses of them:
* fields for which I'd like to ensure speedy queries
* numerous fields linked to lookup tables, for the sake of
guaranteein g referential integrity
* several fields linked to child tables


Do you know about the hidden indexes problem? They are created by
establishing relationships. These will show up in the table
documenter. Also, be careful about the auto-indexing of ID fields
(a setting in the options), which can also create unnecessary
indexes. I once reduced a 45MB data file to under 40MBs by
eliminating these duplicate indexes.
I *do* have instances with multiple fields related to the same
lookup table and would be willing to listen to ways around this.
These are *not* cases where I have been too lazy to introduce a
proper 1:N parent-child relationship (e.g., Patient1ID,
Patient2ID, Patient3ID instead of a 1:N relationship between
tblDoctor and tblDoctorPatien t). Rather, they are more of the
flavour PropertyProvinc eID, LandlordProvinc eID, ManagerProvince ID,
etc., all pointing to the same lookup table, tblProvince.


Hmm. Sounds denormalized to me. Why is information about the
landlord and manager stored in the main record? Sounds like a
separate entity that should be stored elsewhere with a link to the
main record. Actually, it's the other way around, the record in the
table you're having trouble with is the child of a landlord, a
manager. Given that a landlord might have multiple properties,
you'd want a N:N join table between the person and property table,
and the provice would be an attribute of the landlord's address,
which could certainly be stored in a separate table. Indeed, you
could take care of both landlord, manager and tenants with a join
table between your property table and your people table, with a
role code in the join. Data in that table could look something like
this:

PropertyID PersonID RoleCode
1 1 Landlord
1 2 Manager
2 1 Landlord
2 3 Tenant

And so forth (probably throwing the tenants into it is a bad idea,
as the relationship between the property and the tenant is very
different from the other relationships).

I've just eliminated at least two fields from your table.

As to indexes to speed up searches, that's tougher. I have found
that the conventional wisdom about indexes not speeding up sparsely
populated fields (i.e., small number of unique values, the classic
example being a Boolean field, which has only 2 possible values)
sufficiently to justify then is simply not as true as I'd like it
to be. I tried eliminating indexes on all fields that had more than
50% nulls and fewer than 10 unique values, and it made selects on
that field significantly slower.

But it's important to consider how often the selection on that
field will happen and whether the added wait of a table scan is
worth it.

But based on your one example, my bet is that your schema needs
work. That's what you asked about in the first place, so it sounds
like you're on the right track.


David, thanks for your comments. The example of multiple references to
the same lookup table was meant to be an example, not a snippet from
my actual database design. Your issues with my example are well
founded, though not germane to my situation.

I am aware of the hidden indices that result from establishing
relationships. Can these be done away with? If so, how? I thought they
had to live.

Chuck
Nov 12 '05 #5
On Tue, 06 Jan 2004 19:48:27 -0500, Chuck Van Den Corput
<NO************ *****@sympatico .ca> wrote:

Perhaps it would make sense to stop having us guess at your db design,
and post or make available for download an (abbreviated) version.

There are situations where Access runs out of gas. If you reach max
indexes and have a good db design (and you sound like you know more
than the basics), perhaps you need to look at another product. MSDE
ships with Access 2000 and up; that may be a logical place to start.
SQL Server allows 255 unique indexes per table.

-Tom.
<clip>

David, thanks for your comments. The example of multiple references to
the same lookup table was meant to be an example, not a snippet from
my actual database design. Your issues with my example are well
founded, though not germane to my situation.

I am aware of the hidden indices that result from establishing
relationship s. Can these be done away with? If so, how? I thought they
had to live.

Chuck


Nov 12 '05 #6
On Tue, 06 Jan 2004 20:18:03 -0700, Tom van Stiphout
<to*****@no.spa m.cox.net> wrote:
On Tue, 06 Jan 2004 19:48:27 -0500, Chuck Van Den Corput
<NO*********** ******@sympatic o.ca> wrote:

Perhaps it would make sense to stop having us guess at your db design,
and post or make available for download an (abbreviated) version.

There are situations where Access runs out of gas. If you reach max
indexes and have a good db design (and you sound like you know more
than the basics), perhaps you need to look at another product. MSDE
ships with Access 2000 and up; that may be a logical place to start.
SQL Server allows 255 unique indexes per table.

-Tom.


Thanks Tom. I wasn't being intentionally evasive or coy about my
database design. I was just attempting to distill my problem into an
easily recognizable, generic one, rather than have to provide a lot of
boring back story about my specific application.

I appreciate David's input and feel bad that he went into as much
detail as he did, thinking (due to my lack of clarity) that my problem
description was specific and not generic.

I don't post here very often but do certainly appreciate the time and
effort people have taken to help me.

Chuck
Nov 12 '05 #7

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

Similar topics

1
1276
by: crispy | last post by:
This is something that I am never completely sure about: When building an Access db to be accessed by ASP, do I need to worry about setting the Relationships between the tables and the Join Types (one to many ,etc.), or can I just rely on declaring the relationships in my SQL statements? How about the setting for Referential Integrity. Should I ever have to worry about having Access enforce those, including update and deleted related...
2
3905
by: James Ankrom | last post by:
Why does this fail? Dim relResources As New Data.DataRelation("Application_Resources", ..Tables("User_Applications").Columns("Application_id"), ..Tables("Resource_Rights").Columns("Application_id"), False) mUserData.Relations.Add(relResources) relResources.Nested = True Dim UserDataXML As System.Xml.XmlDataDocument = New System.Xml.XmlDataDocument(mUserData)
20
3029
by: Ed | last post by:
I am running Access 2002 and just ran the built in Access wizard for splitting a database into a back end (with tables) and front end (with queries, forms, modules, etc.). After running the wizard, I opened the table relationship view and noticed that all the relationships are missing. Is this supposed to happen? If so, why? I've noticed that queries are behaving strangely now, seemingly because the relationships are not established....
22
2361
by: Bradley | last post by:
Has anyone else noticed this problem? I converted the back-end to A2000 and the performance problem was fixed. We supply a 97 and 2000 version of our software so we kept the backend in A97 to make upgrading simple for users. We've done it like that for years but a new client has been having severe performance issues... solved by converting the backend to 2000. -- regards, Bradley
49
2257
by: Mal | last post by:
Hi, As I gain knowledge through a lot of trial, error, and usenet posts.. I have a potentially odd question. I am using a commercial access application. It is a front-end / back end....multi-user app. with a lot of complex functionality (as you would expect from a commercial app). It doesn't have any relationships though.....is this odd???
2
4148
by: Max | last post by:
Hi. I really hope someone can help me. Going slowly insane with this problem. I have a two Access 2000 databases. One is the backend containing tables and some admin queries. The other is the front end with forms / queries and links to the tables in the back end. From the Relationships window I selected File / Print Relationships. The resulting report shows relationships that are not displayed in the relationships window. Some of...
3
1862
by: Tom van Stiphout | last post by:
I have written some code to export all objects to text files, and to import those files back into a new database. Hopefully this will eliminate some forms of corruption. The icing on the cake would be to copy the relationships window as well. So far, I was trying this code below, but it doesn't work. First off, I'm surprised that on several MDBs the count of objects is 2. I was expecting 1 because an MDB can have only 1 relationship...
11
2035
by: Nemisis | last post by:
Hi everyone, sorry if this post gets really long, i just wanna make sure i fully explain what i am trying to do. I am new to OOP and .net 2.0, so if this is obvious, i am sorry. I have wrote a data access layer, which contists of separate servicebases for each object within my database. CompanyDataService (contains CRUD methods) ContactDataService (contains CRUD methods)
4
3259
by: sloney | last post by:
Hello, I have approximately 20 mdb's that have the same schema but all have different data for different geographic locations. There are a plethora of tables and relationships (to be built). I want to build relationships so that I can run update queries using referential integrity. It is very time consuming to create relationships and I want to do it for one mdb and copy the relationships over to the other mdbs. Is there a way to do this?...
0
9687
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
10484
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
10251
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10228
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
10027
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
9072
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
5463
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
4141
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
3759
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.