If there are a trillion lines and no more, then each can be represented in 40 bits (5 bytes). All you need is a way to use 5 bytes as an index for trillion lines.
How do you know all the trillions of lines? If the compressor and decompressor have access to all trillion rows, or if there is a way to order and recreate the rows, then you only need an index.
, . ( , , ) 32K. 400 . zlib deflateSetDictionary inflateSetDictionary , 32K. .