With the fast growing size and complexity of core network, the hash based data structure of current AS_PATH implementation in BGP is facing challenges in performance, mainly caused by the static attribute of the simple hash. This paper proposed a splay tree based data structure and an optimal index generation algorithm specifically designed for AS_PATH. Exploiting the innate characteristics of AS_PATH, the proposed algorithm shows superior performance.