title: What is the runtime for Repository's default "findById" function in Spring Boot?
body: <p>For simple @PutMapping (see below), does it take the order id and look for the specific order throughout the entire orders table? or does it go to get that specific order directly? </p>
  
  <p>orderRepository is inherited from JpaRepository; database is MySQL</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>//Update a order:
      @PutMapping("/orders/{id}")
      public Order updateOrder(@PathVariable(value = "id") Long orderId, @Valid @RequestBody Order orderDetails) throws OrderNotFoundException {
          Order order = orderRepository.findById(orderId).orElseThrow(() -&gt; new OrderNotFoundException(orderId));
          order.setMerchant(orderDetails.getMerchant());
          order.setStore(orderDetails.getStore());
          Order updatedOrder = orderRepository.save(order);
          return updatedOrder;
      }</code></pre>
  </div>
  </div>
  </p>