-
CustomerNo Item OrderDate Qty RouteNo DeliveryMethod DeliveryDescription
-
98134 3130 2/28/2006 14 488233 3
-
98134 3155 2/28/2006 32 488233 3
-
98134 32238 2/28/2006 12 488233 3
-
98134 32240 2/28/2006 23 488233 3
-
98134 33527 2/28/2006 21 488233 3
-
98134 3685 2/28/2006 19 488233 3
-
98134 63340 2/28/2006 22 488233 3
-
98134 67543 2/28/2006 42 488233 3
-
This is a small test data I made for testing initially correctness of my algorithm.
Now if u observe just (CustomerNo, OrderDate, RouteNo) which from now on I call a TRIPLET. I have just one unique one
-
CustomerNo RouteNo OrderDate
-
98134 488233 2/28/2006
-
A ITEMCLASS looks like this
-
ItemClass OrderPlacement
-
12CAN 10
-
1LTR 190
-
15LTR 180
-
WMPL 100
-
2LTR 50
-
TRH 999
-
x 998
-
I have 15 such itemclasses.
Under each itemclass we have some 30-40 Items.
-
item description ItemClass HazCode ItemLength ItemWidth ItemHeight
-
62609 5G TK JOGUE CLUB SODA PRE x 0 0 0
-
62496 14OZ NR CLRLY CNDIAN BLKBERRY x 0 0 0
-
62497 14OZ NR CLRLY CNDIAN STRWML 1/ x 0 0 0
-
62498 14OZ NR CLRLY CNDIAN GRAPE 1/1 x 0 0 0
-
there are some 10k such items belonging to different classes.
One specialty of an itemclass is that all the items in it will have the same dimensions.
Now a pallet is a single unit loaded on the truck for delivery to stores.
Usually a pallet has all the same type of items or the same itemclass.
So suppose we have say pepsi cans being loaded to a pallet, we check the available volume of the pallet and the volume of each can case(24 cans) and we fill the stuff up. Because the pallet has same item it will be homogeneous.
Now if a pallet has same itemclass items say Pepsi cans, diet pepsi cans, they will still be homogeneous.
But there is a small possibility that we have a half filled pallet of CANs and now we get bottle so in such a case we will need to compute the volume left and hence fill the bottles cases in such a case that (noOfBottles * Vol of Boittle) <= volumeLeftInPallet.
This is packaging.
Now when orders come from really small stores, then the same step gets broken down further say CANS,16oz bottles, 20oz bottle, and so on.
Hence we have another logical division of Layers, each pallet has approx 5 layers. Now I need to show layer by layer insertion. Which is causing the problem. Because in a order of 1.4 million we have some 50000 pallets and each with approx 5 layers ... well u have like 200000 inserts.
Apart from this for each unique TRIPLET, I insert into a temporary table all the records from the original table as this is all the pallets that will be put into a truck. (Because they are going to a particular customer on a particular date by a particular route.) which match and then within this I go thru the itemclass and then items and then make pallets or PACKAGE.
Well thanx a lot for trying to help me guys, its a complicated thing but I am trying my best to make you understand it.
Just let me know if you have some other question.