A master-detail provider is provided for processing user requests for data
stored in one or more data source. The master-detail provider has a query
analyzer, a master-detail link handler, a master query handler and a
detail query handler. The query analyzer analyzes one or more queries
included in a user request, and determines any set of the queries in
which the queries are linked by one or more master-detail links. The
master-detail link handler relates the queries of each set that are
linked by one or more master-detail links as a master query and one or
more detail queries. The master query handler causes preparation of the
master queries to generate master query plans, and generates provider
queries by incorporating the master query plans with related detail
queries and related master-detail links. The detail query handler handles
the detail queries causing preparation of the detail queries to generate
detail query plans.