Rather than specifying a schema+indices or an Elasticsearch like mapping, preprocessing queries to derive the mapping will definitely be the next step.
However, I doubt we will ever derive mappings from application code or (retroactive) profile guided optimization. The biggest problem will become deployments.
We would need to couple application code deployments to deployments of databases even more than we do today (which is a giant problem).
When a new index is needed or new data types we would need to “prime” the datastore in order to get optimal queries from the start.
Even if this application-database deployment issue is fixed through automation it’s likely we wouldn’t want it to be coupled. Database index creation or schema change can take hours or longer. Application code needs to be very nimble. In the days of CI we don’t want Feature A’s database migration to block the deployment of Feature B or BugFix C.
However, I doubt we will ever derive mappings from application code or (retroactive) profile guided optimization. The biggest problem will become deployments.
We would need to couple application code deployments to deployments of databases even more than we do today (which is a giant problem).
When a new index is needed or new data types we would need to “prime” the datastore in order to get optimal queries from the start.
Even if this application-database deployment issue is fixed through automation it’s likely we wouldn’t want it to be coupled. Database index creation or schema change can take hours or longer. Application code needs to be very nimble. In the days of CI we don’t want Feature A’s database migration to block the deployment of Feature B or BugFix C.