making db smarter