Reducing the filesize sounds dubious if the 400 MB is realistic for the requirement.
If a relational database isn't available as an intermediate indexed repository, in which case I'd use that plus
, there is always the C-ISAM file as an intermediate indexed file for AIX. That has meximum 8MTb indexed filesize which can be written unsorted and read back sorted by multiple keys with Perl using
. Actually, I'd go the C-ISAM route anyway for 400 MB if possible because it functions more quickly than most relational solutions.