Sql optimise conflicts resolve branch

PR#9,PR#18 and PR#32 changes included in one PR
if ($fieldsList[$key][0] == 'path')  dont work for me

should be 
if ($fieldsList[$key][0] == 'AS path')  dont work for me