Optimizing Database Operations: Amortized Cost and Cost Allocation Strategies