0.0.11:rebuild sql logic