Check if post id exist in table than only update instead of inserting new row

why use a custom table for this? eliminate the whole save_post function and just use get_post_meta and update_post_meta to check/increment the view count. this is exactly what post meta data is for.