Create post order index stored proc

revised according to our recent discussions with Javier