[ https://issues.apache.org/jira/browse/TC-371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16042958#comment-16042958 ]
ASF GitHub Bot commented on TC-371: ----------------------------------- GitHub user mitchell852 opened a pull request: https://github.com/apache/incubator-trafficcontrol/pull/656 [TC-371] - TO API - optimizes server to ds assignment endpoint You can merge this pull request into a Git repository by running: $ git pull https://github.com/mitchell852/incubator-trafficcontrol tc-371-optimize-server-assignment Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-trafficcontrol/pull/656.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #656 ---- commit 7a15c34a5ed3fa574bdcc51b57a94f1e411d6474 Author: Jeremy Mitchell <mitchell...@gmail.com> Date: 2017-06-08T16:22:32Z one bulk query as opposed to many single queries to optimize performance ---- > Assigning servers to ds thru API takes too long > ----------------------------------------------- > > Key: TC-371 > URL: https://issues.apache.org/jira/browse/TC-371 > Project: Traffic Control > Issue Type: Improvement > Components: Traffic Ops API > Reporter: Jeremy Mitchell > Assignee: Jeremy Mitchell > Priority: Minor > > POST /api/$version/deliveryserviceserver takes the following payload: > { dsId: 42, servers: [1,2,3,4,5,6,7,8,9...] } > and it loops thru each server to perform a query to see if it exists and then > does a query to do an insert into the deliveryservice_server table. so if > you're assigning 500 servers to a ds...you end up with 1000 queries... > need to optimize this endpoint. -- This message was sent by Atlassian JIRA (v6.3.15#6346)