Stratos Idreis's team has been working on exactly this. Automatic design of data structures based on workload.
Their work has been on HN before: https://news.ycombinator.com/item?id=18314555
Their work has been on HN before: https://news.ycombinator.com/item?id=18314555