At work, we're trying to form some sort of metric of how complex a query would be based on how many tables are used, how many joins between them and - if it proves actually better for the calculation - amount of rows.
Is there any system that does this or something similar? If not, what would be the best approach to create a metric with things like these which aren't exactly constant in proportion? In the end, we'd also take into account amount of inputs and amount (or complexity) of data transformations to be done in the query. Is there any missing variable factor that should be taken into account for this?