A simple model of prolog's performance: extensional predicates

  • Authors:
  • Carlos Escalante

  • Affiliations:
  • University of Victoria, Victoria, British Columbia

  • Venue:
  • CASCON '93 Proceedings of the 1993 conference of the Centre for Advanced Studies on Collaborative research: distributed computing - Volume 2
  • Year:
  • 1993

Quantified Score

Hi-index 0.00

Visualization

Abstract

The efficiency of query execution in Prolog depends on the order in which subgoals are stated. Optimizing a query consists of reducing the number of alternatives to be explored by finding a more efficient order for the evaluation of subgoals. Query reordering can be particularly important when the code is generated by a translator, such as the GraphLog translator, one of the tools in 4Thought, a collection of software design tools and methods for assisting software designers.Finding better orderings for the subgoals is easier if estimates of the evaluation costs for the individual subgoals are available. The total cost for a particular ordering can be estimated as the sum of the individual costs of the subgoals, where the cost of each subgoal will depend on the degree of instantiation of its arguments as well as on characteristics of the underlying database.A model of execution for Prolog that can be used to determine estimates of execution costs for any possible query is desirable. This model may be related to the costs of primitive operations that occur during query execution, such as variable unification, backtracking, etc. Thus, the problem is reduced to that of finding the expected number of these basic operations that are performed in the evaluation of a given subgoal. We can easily estimate these quantities in the simple case of a query retrieval. All we need is accurate knowledge of the database profile.