zrhoffman commented on a change in pull request #4953:
URL: https://github.com/apache/trafficcontrol/pull/4953#discussion_r470187341
##########
File path: traffic_ops/traffic_ops_golang/deliveryservice/servers/servers.go
##########
@@ -814,7 +814,7 @@ func (dss *TODSSDeliveryService) Read(h http.Header, useIMS
bool) ([]interface{}
func selectMaxLastUpdatedQuery(where string) string {
return `SELECT max(t) from (
- SELECT max(dss.last_updated) as t from deliveryservice_server
dss ` + where +
+ SELECT max(dss.last_updated) as t from deliveryservice_server
dss JOIN deliveryservice ds ON ds.id = dss.deliveryservice ` + where +
Review comment:
We don't always need this join, only when dsId is a query parameter. How
is the join conditionally added to `serverCountQuery` and `selectQuery`?
##########
File path: traffic_ops/traffic_ops_golang/server/servers.go
##########
@@ -611,7 +611,8 @@ JOIN cdn cdn ON s.cdn_id = cdn.id
JOIN phys_location pl ON s.phys_location = pl.id
JOIN profile p ON s.profile = p.id
JOIN status st ON s.status = st.id
-JOIN type t ON s.type = t.id ` + where +
+JOIN type t ON s.type = t.id
+FULL OUTER JOIN deliveryservice_server dss ON dss.server = s.id ` + where +
Review comment:
As with the comment above, we don't always need this join, only when
dsId is a query parameter.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]