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

Orphaned tupels, should I clean or is it ok to leave?

Hello there,

I was wondering if anyone could give me some advice on orphaned rows and
foreign key constraints.

I am migrating a MS-Access database that didnt have any relations setup
properly, consequently there are gazillions of orphaned tuples.

If I was to leave these as they were and set constraints with NO CHECK is it
likly that I am going to run into problems down the track?

Some may shudder that I would consider not cleaning the data but we have a
timeline and there is months of cleaning to do, its something I would prefer
to do after we make our deadlines.

Thank you
John Sheppard
Jun 27 '08 #1
4 1399
On Fri, 2 May 2008 14:19:57 +1000, "John Sheppard" <sp**@nospam.com>
wrote:

I am a purist and would not allow bad data in my database. But I'm
also a realist and your suggestion makes some sense. However, I have
seen that the desire to clean up the data disappears as the app is
taken into production and no immediate averse effects are noticed. You
and I know that's just a matter of time...
Also look at it this way. If I have Orders for a CustomerID that no
longer exists, I have limited options:
1: Do research in printed invoices in some filing cabinet and try to
find the missing customer and recreate him. A time-consiming
proposition.
2: Delete the orphans. Most are old. None can be recovered easily.
3: Assign all orphans to CustomerID=-1,
CustomerName=UnknownBadStuffLeftFromEarlierDays

Personally I would keep the Access app for research purposes, and
choose option 2. ˇNo Pasarán!

-Tom.

>Hello there,

I was wondering if anyone could give me some advice on orphaned rows and
foreign key constraints.

I am migrating a MS-Access database that didnt have any relations setup
properly, consequently there are gazillions of orphaned tuples.

If I was to leave these as they were and set constraints with NO CHECK is it
likly that I am going to run into problems down the track?

Some may shudder that I would consider not cleaning the data but we have a
timeline and there is months of cleaning to do, its something I would prefer
to do after we make our deadlines.

Thank you
John Sheppard
Jun 27 '08 #2
>If I was to leave these as they were and set constraints with NO CHECK is it likly that I am going to run into problems down the track? <<

oh yeah! The schema will fill with garbage and will choke. Someone
will use the meaningless data for a report, etc.
Jun 27 '08 #3
aj
I can't help but comment here.

We're implementing a 3rd party CRM package, and the software treats the
database like a big pile of stupid ascii files. There's no RI - no FK's
in the tables. NULLs are allowed everywhere... When a PK is deleted,
rather than cascade delete, it looks like any logical references to it
are simply set to null..

Its enough to drive a DBA completely freaking insane...

Is this sort of thing common in CRM packages?

aj

--CELKO-- wrote:
>>If I was to leave these as they were and set constraints with NO CHECK is it likly that I am going to run into problems down the track? <<

oh yeah! The schema will fill with garbage and will choke. Someone
will use the meaningless data for a report, etc.
Jun 27 '08 #4
>It is enough to drive a DBA completely freaking insane...Is this sort of thing common in CRM packages? <<

I don't know about CRM packages, but I worked for a company that did
the same kind of crappy coding in Configuration Management software.
I reviewed a municipal public works package which only had IDENTITY
columns for keys and absolutely no column constraints. I am no longer
amazed at the level of cowboy coding in packages.
>When a PK is deleted, rather than ON DELETE CASCADE, it looks like any logical references to it are simply set to NULL.. <<
Done manually, instead of with ON DELETE SET NULL? You probably don't
remember pre_RDBMS databases, but they often had a bit flag at the
start of a record to mark it as active or deleted. The reason that
records were located by physical position within a file or pointers of
some kind. You would do explicit garbage collection every now and
then to re-claim the disk space and to re-build the pointer chains and
links. Another form of flag for this purpose was to set a link to NIL
by traversing down a chain to the leaf nodes, then recursively back up
the chain to the parent record.

Jun 27 '08 #5

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

Similar topics

8
by: Travis Pupkin | last post by:
Hi, I use a WYSIWYG rich text editor on a few web sites for clients to manage their content, but a lot of them use word and paste into the box and end up with a lot of crappy code as a result. ...
3
by: CSN | last post by:
Every now and then my connection to my remote server will disconnect. If I was using the psql commandline, "ps" will show it's still running (after I log back on). Is there a way to get access to...
1
by: Doc | last post by:
I have a problem, I reinstalled my computer (upgraded to XP) and thought I had a save backup of my database, though now I am not able to open it anymore. I don't have any understanding of how it...
7
by: Felix Kater | last post by:
Hi, when I need to execute a general clean-up procedure (inside of a function) just before the function returns -- how do I do that when there are several returns spread over the whole function?...
0
by: newspost2000 | last post by:
I have built a Domino Web Application. I am looking for a tool that will be able to scour my site and find all files that are orphaned. I have found a few tools on the web that can do this kind of...
7
by: newspost2000 | last post by:
I have a golden list of urls to each and every file on our corporate website. This includes all webpages and file resources. I am looking for a tool whereby I can plug in the base url of our...
0
by: skip | last post by:
Over the past couple days I've been trying to reduce the large number of orphaned wiki pages, deleting many, stitching many others back into the fabric. There are a bunch of orphaned PyCon-related...
6
by: Janette | last post by:
Hi, Can anyone tell me, if you were to open a connection to a database at the top of each ASP page in a website, for example like this <% dim dbconn set...
25
by: Koliber (js) | last post by:
sorry for my not perfect english i am really f&*ckin angry in this common pattern about dispose: ////////////////////////////////////////////////////////// Public class...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.