![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
So, I have a series of tables with different columns (but some 'common') e.g. Sales order items (oritem) Process order stock requirements (orstkall) Picking note items (pickitm) Miscellaneous manual stock reservation ( Each table can provide a requirement for stock based on status of item. I therefore have another table (allocation) which contains the outstanding requirements for stock, from which I need to create a relation back to each of these tables. Allocations for a particular row in any of these tables are stripped and rebuilt frequently. Each of these has a primary key of the same type (int) A cutdown of allocation is shown below This is causing us issues with software like crystal reports, where one cannot include the metadata in the link without effort, and thus 'spurious' links are arising. So, 1. would you strip the metadata from this table? and 2. How would you approach removing the metadata from this table? |
#3
| |||
| |||
|
|
Iain Sharp (iains (AT) pciltd (DOT) co.uk) writes: So, I have a series of tables with different columns (but some 'common') e.g. Sales order items (oritem) Process order stock requirements (orstkall) Picking note items (pickitm) Miscellaneous manual stock reservation ( Each table can provide a requirement for stock based on status of item. I therefore have another table (allocation) which contains the outstanding requirements for stock, from which I need to create a relation back to each of these tables. Allocations for a particular row in any of these tables are stripped and rebuilt frequently. Each of these has a primary key of the same type (int) A cutdown of allocation is shown below This is causing us issues with software like crystal reports, where one cannot include the metadata in the link without effort, and thus 'spurious' links are arising. So, 1. would you strip the metadata from this table? and 2. How would you approach removing the metadata from this table? If I understand this correctly, there is a a column in this allocation table that specified which table the row refers to. That is rarely a good design, and tend to cause problem. Really what you should do is difficult to tell with so little information about the full picture. And then cryptic column names do not help. Am I right to understand that all these orstkall, picktim etc share a common ID space? My reflection is that either all these tables reflects distinct entities, in which case there should be one allocation table per entity. Or they are in fact all the same entity, or subtypes of one, in which case there should be a common table which also owns the ID. But as I said, with so little information it's very difficult to come with design suggestions. |
#4
| |||
| |||
|
|
Each of these tables are different entities, in that one is items for sale to customer, one is items to be used to make items for sale to the customer, one is items reserved to prevent their sale/use. What they all have in common is that they add up to the amount of requirement for the material in the warehouse. So I need to be able to sum them sensibly, and work backwards from this information to the originating table. A sales item will have many different columns from the production item or the stock reservation item, but they all have the same behaviour in common. They all reserve material for use later. This reservation data is then examined either in summary (add up all the reservations for a stock item) or detail ( show me the reservations of all types for this stock item, in due date order), or a bit of both, (add up all the reservations for this stock item due before this date). So I felt I needed an indexed table storing this information, hence ste_allocation. This then has a many to one relationship with rows in the other tables (one sales item may involve several allocations). |
|
They do not currently share the same ID space, but as I am currently changing their primary keys, they could do. If I do this, it will markedly increase the gaps in each of their ID sequences, and I was wondering if I should then be looking at fill factors (the IDs will always be increasing numerically). |
#5
| ||||
| ||||
|
|
Each of these tables are different entities, in that one is items for sale to customer, one is items to be used to make items for sale to the customer, one is items reserved to prevent their sale/use. |
|
What they all have in common is that they add up to the amount of requirement for the material in the warehouse. |
|
A sales item will have many different columns from the production item> or the stock reservation item, but they all have the same behavior in common. They all reserve material for use later. |
|
They do not currently share the same ID space, but as I am currently changing their primary keys, they could do. If I do this, it will markedly increase the gaps in each of their ID sequences, and I was wondering if I should then be looking at fill factors (the IDs will always be increasing numerically). |
#6
| ||||
| ||||
|
|
Each of these tables are different entities, in that one is items for sale to customer, one is items to be used to make items for sale to the customer, one is items reserved to prevent their sale/use. How are they LOGICALLY/PHYSICALLY different? This sounds like a status change and not a new entity. Consider a carton of eggs and a skillet. I cannot un-cook an egg nor find it in a omelet. That is the "different entity", but if I move it from the TRUCK, inspect it and move it to my PANTRY that is a status change |
|
What they all have in common is that they add up to the amount of requirement for the material in the warehouse. Yep! The data model is wrong. This is a status attribute and should not be modeled with tables. You are doing this the way we did it with punch cards and tapes, not RDBMS. A sales item will have many different columns from the production item> or the stock reservation item, but they all have the same behavior in common. They all reserve material for use later. A reserved status! |
|
They do not currently share the same ID space, but as I am currently changing their primary keys, they could do. If I do this, it will markedly increase the gaps in each of their ID sequences, and I was wondering if I should then be looking at fill factors (the IDs will always be increasing numerically). If you were older, you would have seen this design flaw in manual systems that moved items to new physical locations with new physical location identifiers. |
|
Based on 30+ years in the trade, this is probably more than yoyj can do in a Newsgroup. |
#7
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |