Data provider at background

Hello, I am currently working on inventory system. However, I making a craft system that allow player to creaft spcify item by comine multiple item like minecraft. However, I not sure how to build and store data for better query since data table only allow table name instead of an Id. So, I thinking, maybe I can build my own storage that uses binary tree to optimize the my query. Therefore, is there any way build the tree once when game start? and maybe use it across multiple multiple game session?