List:General Discussion« Previous MessageNext Message »
From:Fred T. Krogh Date:June 2 1999 6:03pm
Subject:Optimization
View as plain text  
A recent post by Monty on the difficulty of optimizing subselects,
prompted the following idea which may be anything from great to
worthless!

Given a query, reduce it to a canonical form which contains the
essential information needed for deciding how to perform the query.  The
canoical form would translate a part like "name=Smith" to "name=", since
a later query with Smith replaced by Jones would presumably process the
query in the same way.   (Probably, simple queries should not be looked
for, or entered, in the saved information, where "simple" depends on
whether the saved information is kept in memory on on disk?)

Look up the canonical entry in a history of past queries (hash table
seems plausible).  If found, use the information stored for the method
of processing the query.  If not found, decide how to optimize the
query, and store relevent information in the history of past queries.
If the space for storing past queries is exhausted, delete an entry
based on LRU or some other method.   (I presume the saved information
would include things like the number of entries necessary to prefer
using indexes rather than a sequential search or to prefer searching one
table prior to another.)

Without knowing a lot about how databases are used, I'm guessing that if
this were done for the 1000 last queries one would find the preferred
method for doing the query more often than not.

Regards,
         Fred
fkrogh@stripped

Thread
OptimizationFred T. Krogh2 Jun
  • Re: Creating/droping database using mySQL JDBC driverIII Clayburn W. Juniel1 Oct
Re: Why I will stay with Microsoft SQL ServerGarrett Marone27 Dec
Re: Why I will stay with Microsoft SQL Serverindrek siitan27 Dec
  • AW: Why I will stay with Microsoft SQL Serverwhiskyworld.de27 Dec
    • Re: Why I will stay with Microsoft SQL Serverindrek siitan27 Dec