1470 reduce user tables querying

@Kartones CR this, please. Dashboard tables/visualization request does half database queries with this changes, and some of them are at model level, so some improvement should be transversal. Most of changes are for avoiding double computations, and I think they're safe, but maybe you see something I shouldn't do.
Yep, you can do the trick of checking if vis.id == vis.table.table_visualization.id and reuse it then, that's true.