select source.id as source, target.id as target , st_length(rt.geom) as cost from 
	route_Table rt, vertext_table as source, vertext_table as target
        where source.geom=st_startpoint(rt.geom)
         and  target.geom=st_endpoint(rt.geom);
