Something to try:
Make sure you have enable_partition_pruning
set to on
. I believe documentation states that is the default, but I found it not set before.
https://www.postgresql.org/docs/current/ddl-partitioning.html#DDL-PARTITION-PRUNING
See how it compares for you:
-- see if EXPLAIN is different when pruning is ON
SET enable_partition_pruning = on;
EXPLAIN analyse select * from "IpLocation" where "IpFrom"<=1503395841 and "IpTo">=1503395841 limit 1;
-- compare when pruning is OFF
SET enable_partition_pruning = off;
EXPLAIN analyse select * from "IpLocation" where "IpFrom"<=1503395841 and "IpTo">=1503395841 limit 1;