It is entirely possible to skip decoding, using some external code and component attributes; however some features of SDT are likely to break then (e.g. selection). Why not cache data loaded on the decode in model and then use it for encode?
SortField has "name" attribute. Isn't this information enough?
The problem I have is that the load(...) method is called twice when I sort the table by clicking on the column header. With a fully database backed sorting, this would force me to first run the query with the previous sort order and then again with the new sort order, which is what I want to avoid. I'm looking for a way to avoid the first query on sorting.
SortField has a name attribute. This contains the value of sortExpression. Since I'm using the columns tag to setup columns dynamically, this will always be an EL expression, not a column name literal. I'm looking for a way to directly reference the respective column w/o EL evaluation within the load method. I think it would be a good enhancement to provide more contextual information to the load method, including the table and column components.
You can try to use org.ajax4jsf.model.SerializableDataModel. This will allow you to store data used for rendering and not re-fetch it from DB. Please take a look at livedemo example http://livedemo.exadel.com/richfaces-demo/richfaces/dataTable.jsf?tab=dataModel&cid=4802772 and another example: https://jira.jboss.org/jira/browse/RF-3314 .
Here is the example that shows fully-functional data table and DB interaction, involving dynamic columns: https://jira.jboss.org/jira/browse/RF-4403 . Please take a look.