rewrite insert and update function
rewrite sdb from pdb
clean pdb