AutoFetch

AutoFetch[1] is a technique for automating the normally manual process of specifying prefetching hints for object–relational mapping queries.

Ali Ibrahim and William Cook at the University of Texas at Austin developed the idea of "AutoFetch" including an implementation for Hibernate and followed later by an implementation in Ebean.

Benefits

Improving the modularity of application code

AutoFetch uses the program state (typically the call stack) to classify queries. This means that AutoFetch can tune the same query in different ways depending on HOW it was called.

For example, a Data Access API such as findCustomer(int customerId) can be tuned differently depending on the callers of the method.

Reducing the development and maintenance burden from Developers

Because AutoFetch automatically gathers the profiling information developers do not need to manually try and gather this information and apply performance optimizations to the code.

AutoFetch can monitor the object graph usage so that if the usage changes, the tuning of the query can change to suit. This reduces the code maintenance issues for developers and maintains optimal performance as usage changes over time.

Working Principle

AutoFetch collects object graph usage when queries are executed. It collects the 'profile' information which is later used to automatically tune the query on subsequent executions. The ORM query is tuned by determining and automatically adding the correct prefetch directives for each query.

This has shown to improve the performance of the application by reducing "lazy loading". For ORMs that support partial objects, AutoFetch is able to also tune the query by including the properties that the application uses rather than all properties.

See also

References

  1. ^ Ibrahim, Ali; Cook, William. "Automatic Prefetching by Traversal Profiling in Object Persistence Architectures" (PDF). Retrieved 12 January 2024.

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.