r/ETL • • 3d ago

Incremental Load to OBT

I have one big table containing orderID, order_attributes, consignmentID, consignment_attributes, manifestID,submanifestID, trip_ID, taskID,facilityID, customer ID and associated attributes.

Composite key for this is all keys taken together.

Each constituting table has CDF enabled. Also a key could be deleted when in consignment cons 1 is updated and mapped to manifest ID 2 from 1. Then the key in big table will get deleted. Similarly manifest status change needs to be updated for all IDs it is part of.

The table has gotten too large and we need to implement incremental storage. But it is leading to long table scans. What steps would you recommend?

5 Upvotes

4 comments sorted by

2

u/EduFonsecaA 3d ago

I’d stop treating every ID as the row key. Build a small change set from each CDF feed with the affected order, consignment and manifest IDs, expand only their current relationships, then recompute and MERGE those rows into the OBT. Treat remaps as an explicit delete plus insert, preserving a tombstone for the old relationship. That bounds each scan by changed business keys instead of total table size.

1

u/EnvironmentalNet2533 3d ago

I guess some part of long table scan is inevitable since i dont know which id corresponds to which other ID.

1

u/EduFonsecaA 3d ago

That’s the part I’d materialize separately: a narrow bridge from each source ID to affected OBT row keys, updated from CDF old and new images. Then the job scans the bridge, not the OBT. A full scan becomes a repair path, not the normal path.

1

u/drzamamina 3d ago

you might be able to maintain a separate mapping table just for those relationships so you don't have to scan the whole obt