To improve asinuse performance, following things is done by DFK and Arife,

Speed up the SQL query, another table is created by using aspath table on 
hecate (rrc00). That table contains just two fields and have an index on
AS number,

mysql> create table asinpath (asnum int(11) unsigned, id int(11) unsigned,  
mysql> key (asnum));
mysql> show columns from asinpath;
+-------+------------------+------+-----+---------+-------+
| Field | Type             | Null | Key | Default | Extra |
+-------+------------------+------+-----+---------+-------+
| asnum | int(11) unsigned | YES  | MUL | NULL    |       |
| id    | int(11) unsigned | YES  |     | NULL    |       |
+-------+------------------+------+-----+---------+-------+
2 rows in set (0.07 sec)

First data from aspath table is dumped by using following SQL command,

$mysql -D hecate -N -e "select id, aspath from aspath;" > hecate.aspath

Then, this data is reformatted for new table by using the following perl
code,

$perl ~risops/bin/asinpath.pl < hecate.aspath > hecate.aspath.in

After that, text data is inserted into asinpath table in hecate

mysql> load data local infile "hecate.aspath.in" into table asinpath;

During these proccess, risops user is used on mysql. Since only root and
risops user have required privileges. 

After first insertion is done once,  periodic insertion is done another
perl code /home/risops/bin/aspathconv.pl. That code gets the latest added
new aspath and insert these path into asinpath table.

Finally, according to changes in tables, SQL statement in asinuse.cgi
was modified.