AutoFetch

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

Uses your system voice; voice and rate in settings.

Snapshot

≈ 2 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

See our advice if the article is about you and read our scam warning in case someone asks for money to edit this article. (January 2018) (Learn how and when to remove this message)
(Learn how and when to remove this message)

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

edit edit source

Improving the modularity of application code

edit edit source

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

edit edit source

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

edit edit source

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

edit edit source

References

edit edit source
  1. ^ Ibrahim, Ali; Cook, William. "Automatic Prefetching by Traversal Profiling in Object Persistence Architectures" (PDF). Retrieved 12 January 2024. Wikipedia revision 1305034542, retrieved 2026-11-18
edit edit source

Text derived from https://en.wikipedia.org/w/index.php?oldid=1305034542 under CC BY-SA 4.0; modifications have been made.