I am tasked with designing a table in PostgreSQL (never used it) to load data from flat files. This table will contain ~110M rows. Each row will have a certain range for IP Addresses (e.g.: 0.0.1.0 – 0.0.2.240) and around 20 attributes.
The data needs to be entirely replaced on weekly basis and once a day an update will be done based on daily files.
The application will query this table for a given IP Address. Appropriate range needs to be found and attributes returned.
My plan is to partition the table based on the first octet of the IPs. This will give me 255 partitions. Indexes will be based on Start and End IP for the range.
Please let me know if there are any more helpful ideas for partitioning and indexing? Any good practices will also help.
Best Answer
ip4r
ExtensionThis is an ideal case for ip4r, excerpt from the docs.