DE102006017076B4 - Automatic optimization of query processing in database systems - Google Patents
Automatic optimization of query processing in database systems Download PDFInfo
- Publication number
- DE102006017076B4 DE102006017076B4 DE102006017076.8A DE102006017076A DE102006017076B4 DE 102006017076 B4 DE102006017076 B4 DE 102006017076B4 DE 102006017076 A DE102006017076 A DE 102006017076A DE 102006017076 B4 DE102006017076 B4 DE 102006017076B4
- Authority
- DE
- Germany
- Prior art keywords
- hint
- application
- database
- hints
- text
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000012545 processing Methods 0.000 title claims abstract description 16
- 238000005457 optimization Methods 0.000 title claims abstract description 5
- 238000000034 method Methods 0.000 claims abstract description 16
- 230000008569 process Effects 0.000 claims abstract description 7
- 238000011161 development Methods 0.000 claims description 6
- 230000002123 temporal effect Effects 0.000 claims 1
- 230000006870 function Effects 0.000 description 12
- 230000008859 change Effects 0.000 description 6
- 238000012423 maintenance Methods 0.000 description 5
- 230000001133 acceleration Effects 0.000 description 2
- 230000004913 activation Effects 0.000 description 2
- 230000009849 deactivation Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000013479 data entry Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012946 outsourcing Methods 0.000 description 1
- 230000001502 supplementing effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2453—Query optimisation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
System zur automatischen Optimierung der Anfragebearbeitung in Datenbanksystemen (1), mit mindestens einer relationalen Datenbank (2), mindestens einem Server (3) und mindestens einem Client (4), der für Datenzugriffsanforderungen mit dem Server in Kommunikationsverbindung tritt, wobei das Datenbanksystem (1) einen Optimierer (5) aufweist, der Abläufe von Datenzugriffsanforderungen steuert und der Hints aus Anwendungen (6) des Clients (4) oder des Servers (3) für eine externe Steuerung des Optimierers (5) verwendet, wobei mindestens einer Anwendung (6) Speicherraum für eine Hint-Tabelle (7) zugeordnet ist und daß anstelle eines Hint in der Anwendung bzw. in einem Baustein einer Datenzugriffsanforderung ein Hint-Aufruf vorgesehen ist, durch welchen ein Hint aus der in dem Speicher gespeicherten Hinttabelle (7) zur externen Steuerung des Optimierers (5) aufgerufen wird, dadurch gekennzeichnet, dass die Hints einer Hint-Tabelle individuell über einstellbare Parameter aktivierbar und deaktivierbar sind, wobei die Parameter mindestens einen Parameter für einen Gültigkeitszeitraum eines Hints umfassen.System for the automatic optimization of query processing in database systems (1), with at least one relational database (2), at least one server (3) and at least one client (4) that communicates with the server for data access requests, the database system (1 ) has an optimizer (5) that controls the processes of data access requests and uses hints from applications (6) of the client (4) or the server (3) for external control of the optimizer (5), at least one application (6) Memory space is allocated for a hint table (7) and that instead of a hint in the application or in a module of a data access request, a hint call is provided, by means of which a hint from the hint table (7) stored in the memory for external control of the optimizer (5), characterized in that the hints of a hint table can be activated individually via adjustable parameters and can be deactivated, the parameters comprising at least one parameter for a validity period of a hint.
Description
Die vorliegende Erfindung bezieht sich auf ein System und ein Verfahren zur Optimierung der Anfragebearbeitung in Datenbankmanagementsystemen mit mindestens einer relationalen Datenbank, mindestens einem Server und mindestens einem Client, der für Datenzugriffsanforderungen mit dem Server in Kommunikationsverbindung tritt, wobei das Datenbankmanagementsystem einen Optimierer aufweist, der Abläufe von Datenzugriffsanforderungen steuert und der Hints aus Anwendungen des Clients oder Servers für eine externe Steuerung des Optimierers verwendet.The present invention relates to a system and a method for optimizing query processing in database management systems with at least one relational database, at least one server and at least one client that communicates with the server for data access requests, the database management system having an optimizer that processes controls data access requests and uses the hints from client or server applications for external control of the optimizer.
Entsprechende Optimierungssysteme und entsprechende Verfahren für den Ablauf von Datenzugriffsanforderungen bzw. Datenbankabfragen sind aus dem Stand der Technik insbesondere für die Verwaltung und den Zugriff umfangreicher Datenbanken bekannt. Ein solches System ist beispielsweise das Oracle-Datenbanksystem, welches eine Standardabfragesprache (SQL - Standard Query Language) unterstützt und einen Optimierer verwendet, welcher die Verarbeitung bzw. den Ablauf von Datenbankzugriffsanforderungen bzw. Datenbankabfragen steuert, wobei der Optimierer außerdem Hints unterstützt. Hints sind Anweisungen an den Optimierer, unabhängig von einem von dem Optimierer ansonsten vorgesehenen Ablauf einer Datenbankabfrage zumindest in Teilen eine bestimmte, durch den Hint vorgegebene Ablaufsteuerung vorzunehmen. Beispielsweise könnte eine Datenbankabfrage eine mehr oder weniger komplexe Kombination der Daten verschiedener Tabellen erfordern, wobei die Geschwindigkeit und Effizienz der daraus resultierenden Abfrageergebnisse von der Reihenfolge abhängt, in welcher entsprechende Tabellen bzw. deren Daten miteinander kombiniert bzw. verglichen werden. Der Optimierer verwendet für die Steuerung des Ablaufs allgemeine Kriterien, wie z.B. den relativen Umfang der Tabellen, um eine bestimmte Reihenfolge der Kombinationen vorzunehmen. Dagegen kann dem Benutzer oder Programmierer einer bestimmten Anwendung bekannt sein, daß ein Abfragekriterium gerade in Bezug auf eine ganz bestimmte Tabelle hochselektiv ist, die aber nach dem vom Optimierer verwendeten Schema eine nachgeordnete Rangfolge hätte. Durch einen Hint kann der Optimierer angewiesen werden, bei Bearbeitung der Abfrage mit der Tabelle zu beginnen, für die ein Abfragekriterium hochselektiv ist, was zu einer erheblichen Beschleunigung in der Bearbeitung der gesamten Datenabfrage führen kann. Derartige Hints werden daher von einem Programmierer oder ein entsprechend erfahrener Benutzer aus seiner speziellen Kenntnis einer Anwendung und der Tabellen, auf welche die spezielle Anwendung im Falle von Datenbankabfragen zugreifen kann, in den Programmcode einer Anwendung bzw. in entsprechende Datenbankabfragebausteine einer Anwendung eingefügt.Corresponding optimization systems and corresponding methods for the execution of data access requests or database queries are known from the prior art, in particular for the administration and access to extensive databases. Such a system is, for example, the Oracle database system, which supports a standard query language (SQL - Standard Query Language) and uses an optimizer, which controls the processing or execution of database access requests or database queries, the optimizer also supporting Hints. Hints are instructions to the optimizer, regardless of a sequence of a database query otherwise provided by the optimizer, at least in part to carry out a specific sequence control predetermined by the hint. For example, a database query could require a more or less complex combination of the data from different tables, the speed and efficiency of the resulting query results depending on the order in which corresponding tables or their data are combined or compared with one another. The optimizer uses general criteria to control the process, e.g. the relative size of the tables to make a certain order of combinations. On the other hand, the user or programmer of a certain application can be aware that a query criterion is highly selective precisely with regard to a very specific table, but which would have a subordinate ranking according to the scheme used by the optimizer. A hint can instruct the optimizer to start with the processing of the query with the table for which a query criterion is highly selective, which can lead to a considerable acceleration in the processing of the entire data query. Such hints are therefore inserted into the program code of an application or into corresponding database query modules of an application by a programmer or a correspondingly experienced user from his or her special knowledge of an application and the tables which the special application can access in the case of database queries.
Da sich jedoch sowohl die konkreten Anwendungen als auch die gesuchte Daten enthaltende Dateien oder Tabellen hinsichtlich Umfang und Inhalt erheblich verändern können, ist zumindest von Zeit zu Zeit eine entsprechende Anpassung derartiger Hints erforderlich. Ebenso können neue Datenbankabfragen aufgrund sich ändernder oder neuer Anwendungen oder aufgrund neuer Dienstleistungsangebote die Entwicklung und den Einsatz neuer Hints erfordern. Dies bedingt allerdings Unterbrechungen des Ablaufs der Anwendung, da bei einer Änderung von Hints unmittelbar in den Programmcode eingegriffen wird.However, since both the specific applications and the files or tables containing the searched data can change considerably with regard to scope and content, a corresponding adjustment of such hints is necessary at least from time to time. Likewise, new database queries due to changing or new applications or due to new service offerings may require the development and use of new hints. However, this necessitates interruptions in the course of the application, since if the Hints change, the program code is immediately interfered with.
Darüber hinaus muß dies im Falle einer Vielzahl von unterschiedlichen Anwendungen regelmäßig und unabhängig voneinander für alle Anwendungen wiederholt werden, wobei teilweise die in verschiedenen Anwendungen verwendeten Hints identisch sein können.In addition, in the case of a large number of different applications, this must be repeated regularly and independently of one another for all applications, and in some cases the hints used in different applications can be identical.
Die entsprechende Pflege von Anwendungen einschließlich der darin eingebetteten Hints ist relativ zeit- und kostenaufwendig, insbesondere dann, wenn ein Anwendungsprogramm sehr umfangreich ist und gleichzeitig von einer großen Zahl von Benutzern verwendet wird, deren Arbeit für eine entsprechende Wartung und Pflege des Anwendungsprogramms unterbrochen werden muß. Alternativ muß eine solche Pflege außerhalb üblicher Betriebszeiten erfolgen. Allerdings gibt es Anwendungen, die im 24-Stunden-Betrieb laufen und insbesondere auch Anwendungen, die in weltweit vernetzten Systemen laufen, so daß eine Unterbrechung des Betriebs, und sei es nur zur Neuinstallation bzw. Ergänzung der Hints durch Patches oder dergleichen, in jedem Fall aufwendig und kostenintensiv und mit Unannehmlichkeiten für den Anwender verbunden ist.Appropriate maintenance of applications, including the hints embedded therein, is relatively time-consuming and costly, especially when an application program is very large and is used by a large number of users at the same time, whose work must be interrupted for appropriate maintenance and care of the application program . Alternatively, such maintenance must take place outside of normal operating hours. However, there are applications that run in 24-hour operation and in particular also applications that run in globally networked systems, so that the operation is interrupted, if only for reinstalling or supplementing the Hints with patches or the like, in each Case is complex and costly and inconvenient for the user.
Aus der
Die
Gegenüber diesem Stand der Technik liegt der vorliegenden Erfindung die Aufgabe zugrunde, ein System und ein Verfahren der eingangs genannten Art zu schaffen, welche eine wesentlich schnellere und einfachere Anpassung der Optimierung von Datenbankzugriffsanforderungen bzw. Datenbankabfragen erlauben.Compared to this prior art, the object of the present invention is to create a system and a method of the type mentioned at the outset, which allow a much faster and easier adaptation of the optimization of database access requests or database queries.
Diese Aufgabe wird dadurch gelöst, daß einer Anwendung Speicherraum für das Speichern von Hints in einer der Anwendung zugeordneten Hint-Tabelle zugewiesen wird oder ist, und daß in der Anwendung bzw. einem Baustein der Anwendung für eine Datenbankabfrage anstelle eines Hints ein Hint-Aufruf vorgesehen ist, durch welchen ein Hint aus der Hint-Tabelle aufgerufen wird.This object is achieved in that an application is or is allocated memory space for storing hints in a hint table assigned to the application, and in that a hint call is provided in the application or a component of the application for a database query instead of a hints is by which a hint is called from the hint table.
Demnach sieht die vorliegende Erfindung vor, daß jeder Anwendung Speicherplatz bzw. Speicherraum für die Aufnahme einer zugeordneten Hint-Tabelle zugeordnet ist, und die zuvor in Programmcode der Anwendung oder eines Bausteins für Datenbankabfragen eingebetteten, statischen Hints werden durch Hint-Aufrufe ersetzt, die einen durch den Aufruf näher bezeichneten Hint aus der Hint-Tabelle aufrufen.Accordingly, the present invention provides that each application is allocated storage space for the storage of an associated hint table, and the static hints previously embedded in program code of the application or a module for database queries are replaced by hint calls, which one call the hint specified by the call from the hint table.
Dadurch wird es möglich, die bis dahin statischen Hints jederzeit dynamisch zu variieren, indem, ohne daß die Anwendung in irgendeiner Weise unterbrochen wird, die zugehörige Hint-Tabelle aktualisiert wird. Dadurch kann die externe Steuerung bzw. Beeinflussung des Optimierers durch Hints wesentlich schneller und einfacher den tatsächlichen Verhältnissen und Bedürfnissen angepaßt werden.This makes it possible to dynamically vary the previously static hints at any time by updating the associated hint table without interrupting the application in any way. As a result, the external control or influencing of the optimizer by Hints can be adapted to the actual conditions and needs much more quickly and easily.
In der bevorzugten Ausführungsform der Erfindung ist vorgesehen, daß der Aufruf dadurch erfolgt, daß anstelle eines Hints in einer Anwendung eine Hint-Variable eingebettet ist, die entsprechend definiert ist und eine Kennung bzw. Text aufweist, durch welche der an dieser Stelle aus der Tabelle einzufügende Hint eindeutig definiert ist.In the preferred embodiment of the invention it is provided that the call is made by embedding a hint variable in place of a hint in an application, which is defined accordingly and has an identifier or text by which the one from the table at this point the hint to be inserted is clearly defined.
Weiterhin ist eine Ausführungsform der Erfindung bevorzugt, bei welcher für unterschiedliche Anwendungen unabhängig und getrennt Hint-Tabellen zugeordnet sind. Dies schließt jedoch nicht aus daß eine Hinttabelle gleichzeitig zwei oder mehr verschiedenen Anwendungen zugeordnet ist, insbesondere, wenn die Anwendungen relativ große Ähnlichkeiten aufweisen, die zu identischen oder ähnlichen Datenbankabfragen führen.Furthermore, an embodiment of the invention is preferred in which hint tables are assigned independently and separately for different applications. However, this does not exclude that a back table is assigned to two or more different applications at the same time, especially if the applications have relatively large similarities which lead to identical or similar database queries.
Weiterhin wird zweckmäßigerweise eine Master-Tabelle von Hints im Rahmen einer zentralen Hint-Verwaltung bereitgestellt und gepflegt, wobei die jeweils einzelnen Anwendungen zugeordneten Hint-Tabellen Teilmengen der Hints aus der Master-Tabelle sind und entsprechend dem speziellen Bedarf jeder Anwendung ausgewählt werden. Auf diese Weise wird die mehrfache identische oder ähnliche Entwicklung von Hints durch verschiedene Personen vermieden, da alle für eine Vielzahl von Anwendungen in einem großen, gegebenenfalls vernetzten System wie zum Beispiel in einem „Wide Area Network“ (großräumigen Netzwerk) benötigten Hints zentral verwaltet und gespeichert werden, auch wenn Teilmengen der zentralen Hinttabelle jeweils getrennt einzelnen Anwendungen zugewiesen und in den Anwendungen zugeordnetem Speicherraum gespeichert sind.Furthermore, a master table of hints is expediently provided and maintained within the framework of a central hint administration, the hint tables assigned to individual applications being subsets of the hints from the master table and being selected in accordance with the special requirements of each application. In this way, the multiple identical or similar development of hints by different people is avoided, since all hints required for a large number of applications in a large, possibly networked system, for example in a “wide area network”, are centrally managed and are stored, even if subsets of the central hint table are each separately allocated to individual applications and stored in the memory space allocated to the applications.
Ohnehin entwickelt die vorliegende Erfindung ihre Vorzüge vor allem in Verbindung mit sehr großen Systemen, insbesondere Datenbank mit mehr als 200 GB und vorzugsweise mehr als 500 GB Speicherraum mit einer großen Zahl von Daten, die in einer entsprechenden Vielzahl von Tabellen oder anderen Dateien abgelegt sind. Kleinere Systeme kommen oft ohne Hints aus, wobei jedoch grundsätzlich gilt, daß die vorliegenden Erfindung umso sinnvoller und effektiver einsetzbar ist, je umfangreicher und komplexer die Datenbanken und je langsamer die verwendeten Prozessoren bzw. je geringer deren Kapazitäten sind.In any case, the present invention develops its advantages especially in connection with very large systems, in particular a database with more than 200 GB and preferably more than 500 GB of storage space with a large number of data which are stored in a corresponding plurality of tables or other files. Smaller systems often get by without hints, although the basic principle is that the more extensive and complex the databases and the slower the processors used or the lower their capacities, the more useful and effective the present invention can be used.
Zweckmäßigerweise ist vorgesehen, daß die Hints einer Hint-Tabelle wahlweise aktiviert oder deaktiviert werden können. Dies ermöglicht insbesondere eine einfache Parametersteuerung, indem die Aktivierung oder Deaktivierung eines Hints von dem Wert eines konkreten, variablen bzw. einstellbaren Parameters abhängig gemacht wird. Beispielsweise ist es gemäß einer bevorzugten Variante möglich, bestimmte Hints nur für bestimmte Zeiträume zu aktivieren.It is expediently provided that the hints of a hint table can optionally be activated or deactivated. This enables, in particular, simple parameter control, in that the activation or deactivation of a rear is made dependent on the value of a specific, variable or adjustable parameter. For example, according to a preferred variant, it is possible to activate certain hints only for certain periods.
Darüber hinaus ist es zweckmäßig, wenn ein Dokumentationssystem vorgesehen ist, welches die zeitliche Entwicklung der einzelnen Hint-Tabellen und insbesondere der Master-Hint-Tabelle dokumentiert und archiviert.In addition, it is expedient if a documentation system is provided which documents and archives the chronological development of the individual hint tables and in particular the master hint table.
Die vorliegende Erfindung ist auch auf ein entsprechendes Verfahren gerichtet, welches ein Datenbankmanagementsystem mit mindestens einer relationalen Datenbank, mindestens einem Server und mindestens einem Client aufweist, der für Datenbankabfragen mit dem Server in Kontakt tritt, wobei das Datenbankmanagementsystem einen Optimierer aufweist, der Abläufe der Bearbeitung von Datenbankabfragen steuert und der aus Anwendungen des Clients oder Servers Hints für eine externe Steuerung verwendet. Hinsichtlich eines solchen Verfahrens ist erfindungsgemäß vorgesehen, daß anstelle eines Hints in einer Anwendung oder einem Abfragebaustein einer Anwendung ein Hint-Aufruf vorgesehen ist, durch welchen ein Hint aus einer der Anwendung zugeordneten Hint-Tabelle aufgerufen wird. The present invention is also directed to a corresponding method which has a database management system with at least one relational database, at least one server and at least one client which comes into contact with the server for database queries, the database management system having an optimizer which processes the processing controls database queries and uses hints from client or server applications for external control. With regard to such a method, the invention provides that instead of a hint in an application or a query block of an application, a hint call is provided, by means of which a hint is called from a hint table assigned to the application.
Für die Speicherung der Hint-Tabelle muß der jeweiligen Anwendung entsprechender Speicherraum zugewiesen werden. Die Zugriffsrechte auf Hints und die Möglichkeiten zum Ändern von Hints können je nach Bedarf unterschiedlich vergeben werden. In der bevorzugten Ausführungsform der Erfindung wird eine zentrale Master-Hint-Tabelle von einem Administrator verwendet, der auch festlegt, welche Hints aus der Master-Hint-Tabelle zur Erzeugung der den jeweiligen Anwendungen zugeordneten, individuellen Hint-Tabellen verwendet und/oder aktiviert werden. Dabei ist es insbesondere in einfacher Weise möglich, daß unterschiedliche Anwendungen unterschiedliche Sätze und Hints in ihren jeweiligen Tabellen aufweisen, die aber sehr wohl in weiten Bereichen überlappen können und auf diese Weise entsprechende Hints nur einmal zentral erstellt werden müssen, die dann in verschiedenen Anwendungen mehrfach bzw. in gleicher Weise verwendet werden können. Gegebenenfalls können untergeordnete Operatoren oder Administratoren gewisse Zugriffsrechte auf individuelle Hint-Tabellen erhalten, die es beispielsweise ermöglichen, bestimmte Hints zu aktivieren oder zu deaktivieren oder Zeiträume der Aktivierung und Deaktivierung von Hints festzulegen. Vorzugsweise wird jedoch auch dies zentral von einem Hint-Verwaltungssystem aus vorgenommen, von welchem aus der alleinige Zugriff auf die Master-Hint-Tabelle besteht.Corresponding memory space must be allocated to the respective application in order to save the hint table. The access rights to hints and the options for changing hints can be assigned differently as required. In the preferred embodiment of the invention, a central master hint table is used by an administrator who also specifies which hints from the master hint table are used and / or activated to generate the individual hint tables assigned to the respective applications . It is in particular possible in a simple manner that different applications have different sentences and hints in their respective tables, but they can very well overlap in large areas and in this way corresponding hints only have to be created centrally once, which then occurs several times in different applications or can be used in the same way. If necessary, subordinate operators or administrators can be granted certain access rights to individual hint tables, which make it possible, for example, to activate or deactivate certain hints or to define periods for the activation and deactivation of hints. However, this is also preferably carried out centrally from a hint management system from which there is sole access to the master hint table.
Weitere Vorteile, Merkmale und Ausführungsformen der vorliegenden Erfindung werden deutlich anhand der folgenden Beschreibung eines anhand einer Figur schematisch wiedergegebenen Ausführungsbeispiels sowie anhand weiterer konkreter Beispiele aus einer gegebenen Datenbankumgebung.Further advantages, features and embodiments of the present invention will become clear on the basis of the following description of an exemplary embodiment shown schematically on the basis of a figure and on the basis of further concrete examples from a given database environment.
In der einzigen Figur erkennt man schematisch dargestellt ein Datenbankmanagementsystem
Im Falle einer Datenbankabfrage, die im Rahmen einer Anwendung
Der Optimierer versucht, die Reihenfolge logischer Operationen in der Weise zu steuern, daß das Ergebnis der Datenbankabfrage möglichst ökonomisch und in möglichst kurzer Zeit erzielt wird. Dem Benutzer der Anwendung
Gemäß der vorliegenden Erfindung sind jedoch die Hints nicht als solche in die Anwendung
Erfindungsgemäß ist zusätzlich ein Hint-Managementsystem vorgesehen, welches eine Master-Hint-Tabelle
Im folgenden werden noch zwei Ausführungsbeispiele der vorliegenden Erfindung anhand zweier Beispiele beschrieben, wobei zunächst nochmals das Wesen der Hint-Verarbeitung erläutert wird.Two exemplary embodiments of the present invention are described below with the aid of two examples, the essence of the hint processing being explained again first.
Hint-VerarbeitungHint processing
Hints sind in SQL-Code eingebettete Anweisungen für den Oracle-Optimizer, die den Ausführungsplan von SQL-Statements beeinflussen. Die Benutzung von Hints ist dann zwingend notwendig, wenn fachliches Wissen in die Ausführung von SQL-Statements fließen soll. Woher soll der Optimizer z. B. wissen, daß ein Index mit dem Feld Fehlerkennzeichen für den Fall „Ja“ hoch selektiv, für den Fall „Nein“ aber überhaupt nicht selektiv ist. Hints sind weiterhin dann nötig, wenn der Optimizer - aus welchen Gründen auch immer - nicht den gewünschten / optimalen Ausführungsplan nimmt.Hints are instructions for the Oracle Optimizer embedded in SQL code that influence the execution plan of SQL statements. The use of hints is absolutely necessary if technical knowledge is to flow into the execution of SQL statements. Where should the optimizer z. For example, you know that an index with the field error indicator is highly selective for the "Yes" case, but not at all selective for the "No" case. Hints are still necessary if - for whatever reason - the optimizer does not take the desired / optimal execution plan.
Um dynamisch (d.h. ohne Programmanpassungen) Hints ändern zu können, ist eine über Stammdatentabellen steuerbare Hint-Verwaltung entwickelt worden. Zur Benutzung dieser Hintverwaltung müssen die Aufrufstellen der Datenbankanforderungen in einem Programm eindeutig identifizierbar sein (z.B. durch eindeutige Nummerierung oder Auslagerung in Programmmodule mit eindeutig zugeordnetem Namen). Diese Eindeutigkeit ist notwendig, damit aus den Stammdatentabellen der Hintverwaltung der jeweils zugehörige Hintdatensatz gezogen werden kann, der anschließend über eine Programmvariable an das Datenbankanforderungsstatement übergeben werden kann. Am Beispiel einer Implementierung in der SAP Programmiersprache ABAP wird die Hintbenutzung nachfolgend aufgezeigt. Hierbei sind die Datenbankanforderungszugriffe in modularisierte Einheiten (Funktionsbausteine) ausgelagert.In order to be able to change Hints dynamically (i.e. without program adjustments), a hint management system that can be controlled via master data tables has been developed. To use this back-up management, the call points of the database requirements must be clearly identifiable in a program (e.g. by unique numbering or outsourcing in program modules with a clearly assigned name). This uniqueness is necessary so that the respective back data record can be drawn from the master data tables of the back office, which can then be transferred to the database request statement via a program variable. Using an implementation in the SAP programming language ABAP is shown below. The database request accesses are outsourced to modularized units (function modules).
- * Beginn der Definition des Funktionsbausteins FUNCTION TABELLE_READ_TABLE* Start of the definition of the function block FUNCTION TABLE_READ_TABLE
- * Datendeklaration eine 40stelligen Charactervariablen, die den Hinttext aufnimmt DATA: vl_hint_text(40) type c.* Data declaration of a 40-character character variable that takes up the hint text DATA: vl_hint_text (40) type c.
- * Aufruf der Prozedur (ABAP Macro) get-hint für die Hintermittlung* Call the procedure (ABAP Macro) get-hint for the transmission
- * durch die Übergabe der Variablen cl_objname vp_sel_num und vp_num wird die* by passing the variables cl_objname vp_sel_num and vp_num the
- * Aufrufstelle der* Call point of the
- * Datenbankanforderung eindeutig identifiziert get-hint cl_objname vp_sel_num vp_num vl_hint_text* Database requirement clearly identified get-hint cl_objname vp_sel_num vp_num vl_hint_text
- * dynamisch ermittelter Hinttext im SELECT Statement einbauen. Dadurch übergibt die* Include dynamically determined hint text in the SELECT statement. Thereby passes the
- * SAP-Datenbankschnittstelle den Hinttext an die Datenbank* SAP database interface the hint text to the database
- * (hier z.B. ORACLE Datenbanksystem) select * from TABLE where ... %_hints oracle vl_hint_text* (here e.g. ORACLE database system) select * from TABLE where ...% _hints oracle vl_hint_text
Ob Hints tatsächlich benötigt werden, wird während der Entwicklung, im Test oder im produktiven Einsatz festgestellt. Die entsprechende Pflege der Hintstammdaten erfolgt z.B. durch die Datenbankadministratoren oder die technischen Betreuer der Anwendungen. Ist für eine Aufrufstelle einer Datenbankanforderung kein Hint in der Hinttabelle eingetragen, bewirkt das Einfügen des Hinttextes %_hints keine Änderung des Datenbank-Zugriff.Whether hints are actually needed is determined during development, testing or in productive use. The corresponding maintenance of the master data is carried out, for example, by the database administrators or the technical supervisors of the applications. Is for a call point of a database request If no hint is entered in the hint table, inserting the hint text% _hints does not change the database access.
Um dynamisch (d.h. ohne Programmanpassungen) Hints ändern zu können, ist eine über Stammdatentabellen steuerbare Hint-Verwaltung entwickelt worden. Zur Benutzung dieser Hint-Verwaltung sind folgende ABAP-Statements in den DB-Zugriffsbausteinen zu implementieren:
- • Deklaration einer Variablen vl_hint_text:
- DATA: vl_hint_text like /Irs/s00shint-hint_text.
- • Aufruf des Makros get-hint get-hint cl_objname vp_whenum ‚00‘ vl_hint_text
- • Evtl. Aufruf des Macros get-hint-from-itab get-hint-from-itab vl_select_nummer vl_lauf_nummer vl_hint_text
- • Hint-Text im SELECT einbauen
- • select * from tabname where ... %_hints oracle vl_hint_text
- • Declaration of a variable vl_hint_text:
- DATA: vl_hint_text like / Irs / s00shint-hint_text.
- • Call the macro get-hint get-hint cl_objname vp_whenum '00' vl_hint_text
- • Possibly. Call of the macro get-hint-from-itab get-hint-from-itab vl_select_number vl_lauf_number vl_hint_text
- • Include hint text in the SELECT
- • select * from tabname where ...% _hints oracle vl_hint_text
Bei der Entwicklung neuer DB-Zugriffsbausteine ist die Benutzung der dynamischen Hint-Verwaltung Pflicht. Dabei ist das Macro get-hint standardmäßig mit der Select-Nummer ‚00‘ (3. Übergabeparameter) aufzurufen. Dieser Aufruf findet pro Funktionsbaustein genau einmal zu Beginn statt und füllt eine interne Tabelle mit allen Hint-Texten für diese When-Nummer und speziell die Variable vl_hint_text mit dem Hint-Text für den Standardfall ‚00‘ ‚01‘. Weitere Hint-Text Selektionen für diese When-Nummer finden dann bei Bedarf nur noch über das Macro get-hint-from-itab (siehe unten) statt.When developing new DB access modules, the use of dynamic hint management is mandatory. The macro get-hint can be called by default with the select number '00' (3rd transfer parameter). This call takes place exactly once at the beginning of each function module and fills an internal table with all the hint texts for this when number and especially the variable vl_hint_text with the hint text for the standard case '00' '01'. Further hint-text selections for this when number can then only be made via the macro get-hint-from-itab (see below).
Ob Hints tatsächlich benötigt werden, wird während der Entwicklung, im Test oder im produktiven Einsatz festgestellt. Die entsprechende Pflege der Hint-Stammdaten erfolgt durch DP/AI. Ist für eine bestimmte When-Nummer kein Stammdaten-Eintrag vorhanden, bewirkt das Einfügen des HintTextes (%_hint...) im Select-Statement keine Änderung beim DB-Zugriff.Whether hints are actually needed is determined during development, testing or in productive use. The corresponding maintenance of the master data is done by DP / AI. If there is no master data entry for a certain when number, inserting the hint text (% _hint ...) in the select statement does not change the DB access.
Beispiel 1 (Standardfall):Example 1 (standard case):
FUNCTION /LRS/USTC01_READ_TABLEFUNCTION / LRS / USTC01_READ_TABLE
constants: cl_objname(9) type c value ‚USTC01_RT‘.
data vl_hint_text like /lrs/s00shint-hint_text.
Hint Text abholen
get-hint cl_objname vp_whenum ‚00‘ vl_hint_text.
* welchen Select nehmen ?
case vp_whenum.
when 1.
select * into corresponding fields of table tp_ustc01
from /lrs/s00bustc
%_hints oracle vl_hint_text.
constants: cl_objname (9) type c value 'USTC01_RT'.
data vl_hint_text like / lrs / s00shint-hint_text.
Get back text
get-hint cl_objname vp_whenum '00' vl_hint_text.
* which select to take?
case vp_whenum.
when 1.
select * into corresponding fields of table tp_ustc01
from / lrs / s00bustc
% _hints oracle vl_hint_text.
Beispiel 2 : 2 Hints für ein Select innerhalb einer When-Nummer.Example 2: 2 Hints for a select within a when number.
Falls in einem Select-Statement unterschiedliche Hints in Abhängigkeit von der Datenkonstellation eingesetzt werden müssen, wird zuerst das Macro get-hint wie oben beschrieben aufgerufen. Abhängig von der Datenkonstellation wird dann mit dem Macro get-hint-from-itab unter Angabe der entsprechenden Select- (
function /lrs/cova01_read_table. constants: cl_objname(9) type c value ‚COVA01_RT‘. data : vl_hint_text like /lrs/s00shint-hint_text. * Standardaufruf des Makros get-hint cl_objname vp_whenum ‚00‘ vl_hint_text. * welchen Select nehmen ? case vp_whenum. when 81. if vp_sel_bpsaaid_btva > 0. * Makro get-hint-from-itab aufrufen mit laufender Nummer 02 get-hint-from-itab ‚00‘ ‚02‘ vl_hint_text. endif. select * from /lrs/s00bcova appending table tp_cova01 where custaid = vp_sel_cltaid %_hints oracle vl_hint_text.If different hints must be used in a select statement depending on the data constellation, the macro get-hint is first called as described above. Depending on the data constellation, the macro get-hint-from-itab is then specified with the corresponding select (
function / lrs / cova01_read_table. constants: cl_objname (9) type c value 'COVA01_RT'. data: vl_hint_text like / lrs / s00shint-hint_text. * Standard call of the macro get-hint cl_objname vp_whenum '00' vl_hint_text. * which select to take? case vp_whenum. when 81. if vp_sel_bpsaaid_btva> 0. * Call macro get-hint-from-itab with consecutive number 02 get-hint-from-itab '00''02' vl_hint_text. endif. select * from / lrs / s00bcova appending table tp_cova01 where custaid = vp_sel_cltaid % _hints oracle vl_hint_text.
Beispiel 3 : mehrere Hints für mehrere Selects innerhalb einer When-Nummer.Example 3: multiple hints for multiple selects within a when number.
Falls innerhalb einer When-Nummer mehrere Selects (für unterschiedliche oder gleiche Tabellen) auftreten, wird zuerst das Macro get-hint wie oben beschrieben aufgerufen. Für jedes Select wird dann mit dem Macro get-hint-from-itab unter Angabe der entsprechenden Select- (
function /lrs/agnt91_read_table. constants: cl_objname(9) type c value ‚AGNT91_RT‘. data : vl_hint_text like /lrs/s00shint-hint_text. * Standardaufruf des Makros get-hint cl_objname vp_whenum ‚00‘ vl_hint_text. * welchen Select nehmen ? case vp_whenum. When 10. * Makro get-hint-from-itab aufrufen mit Select-Nummer 00 get-hint-from-itab ‚00‘ ‚01‘ (eigentlich nicht notwendig, da vl_hint_text schon durch Aufruf get-hint richtig gefüllt) .Select * from /LRS/S00SCARRR Where ... %_HINTS ORACLE VL_HINT_TEXT * Makro get-hint-from-itab aufrufen mit Select-Nummer 01 get-hint-from-itab ‚01‘ ‚01‘ (füllt vl_hint_text für Select-Nummer 01, laufende Nummer 01. Select * from /LRS/S00SADRS Where ... (Ergebnisse aus select 1) %_HINTS ORACLE VL_HINT_TEXT When 11.If several Selects (for different or the same tables) occur within a When number, the macro get-hint is called up as described above. For each select, the macro get-hint-from-itab is then used, specifying the corresponding select (
function / lrs / agnt91_read_table. constants: cl_objname (9) type c value 'AGNT91_RT'. data: vl_hint_text like / lrs / s00shint-hint_text. * Standard call of the macro get-hint cl_objname vp_whenum '00' vl_hint_text. * which select to take? case vp_whenum. When 10. * Call the macro get-hint-from-itab with select number 00 get-hint-from-itab '00''01' (actually not necessary, since vl_hint_text is already filled correctly by calling get-hint) .Select * from / LRS / S00SCARRR Where ... % _HINTS ORACLE VL_HINT_TEXT * Call macro get-hint-from-itab with select number 01 get-hint-from-itab '01''01' (fills vl_hint_text for select number 01, consecutive number 01. Select * from / LRS / S00SADRS Where ... (results from select 1) % _HINTS ORACLE VL_HINT_TEXT When 11.
Claims (8)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
DE102006017076.8A DE102006017076B4 (en) | 2006-04-10 | 2006-04-10 | Automatic optimization of query processing in database systems |
PCT/EP2007/051296 WO2007115847A1 (en) | 2006-04-10 | 2007-02-09 | Automatic optimisation of request processing in databank systems |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
DE102006017076.8A DE102006017076B4 (en) | 2006-04-10 | 2006-04-10 | Automatic optimization of query processing in database systems |
Publications (2)
Publication Number | Publication Date |
---|---|
DE102006017076A1 DE102006017076A1 (en) | 2007-10-11 |
DE102006017076B4 true DE102006017076B4 (en) | 2020-04-23 |
Family
ID=37908138
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
DE102006017076.8A Active DE102006017076B4 (en) | 2006-04-10 | 2006-04-10 | Automatic optimization of query processing in database systems |
Country Status (2)
Country | Link |
---|---|
DE (1) | DE102006017076B4 (en) |
WO (1) | WO2007115847A1 (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030236782A1 (en) | 1998-10-05 | 2003-12-25 | Oracle International Corporation | Dynamic generation of optimizer hints |
US20040019587A1 (en) | 2002-07-25 | 2004-01-29 | You-Chin Fuh | Method and device for processing a query in a database management system |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6345266B1 (en) * | 1998-12-23 | 2002-02-05 | Novell, Inc. | Predicate indexing for locating objects in a distributed directory |
US7139749B2 (en) * | 2002-03-19 | 2006-11-21 | International Business Machines Corporation | Method, system, and program for performance tuning a database query |
US20050138015A1 (en) * | 2003-09-06 | 2005-06-23 | Oracle International Corporation | High load SQL driven statistics collection |
US7444389B2 (en) * | 2003-12-09 | 2008-10-28 | Emc Corporation | Methods and apparatus for generating a content address to indicate data units written to a storage system proximate in time |
-
2006
- 2006-04-10 DE DE102006017076.8A patent/DE102006017076B4/en active Active
-
2007
- 2007-02-09 WO PCT/EP2007/051296 patent/WO2007115847A1/en active Application Filing
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030236782A1 (en) | 1998-10-05 | 2003-12-25 | Oracle International Corporation | Dynamic generation of optimizer hints |
US20040019587A1 (en) | 2002-07-25 | 2004-01-29 | You-Chin Fuh | Method and device for processing a query in a database management system |
Also Published As
Publication number | Publication date |
---|---|
WO2007115847A1 (en) | 2007-10-18 |
DE102006017076A1 (en) | 2007-10-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
DE69934894T2 (en) | METHOD AND DEVICE FOR OPTIONALLY ADJUSTING ACCESS TO APPLICATION FEATURES | |
EP0910829B1 (en) | Database system | |
DE4218025C2 (en) | Apparatus and method for automatically associating data storage devices in a computer system | |
EP0829046B1 (en) | Method and system for setting up user programs as well as user computer in a computer net | |
DE10210280B4 (en) | Controls, tools and these comprehensive systems | |
DE10048942A1 (en) | Software product maintaining method in client computer system, by downloading data required for software maintenance from local memory and another memory during execution of software maintenance at client system | |
DE3232675A1 (en) | METHOD FOR CONTROLLING DATA ACCESS IN A COMPUTER AND DATA CONTROL SYSTEM FOR IMPLEMENTING THE METHOD | |
DE69723500T2 (en) | Data quality management system | |
EP1638028A2 (en) | Computer aided generation and change management for user interfaces | |
EP1637956A1 (en) | Generation of anonymized data sets for testing and developping applications | |
DE10320711A1 (en) | Method and arrangement for setting up and updating a user interface for accessing information pages in a data network | |
DE102006017076B4 (en) | Automatic optimization of query processing in database systems | |
EP2606403A1 (en) | Method and arrangement for planning and/or programming a project of an industrial automation arrangement | |
DE102004007231B4 (en) | Method for configuring an automation component of an automation system and corresponding automation system | |
WO1999017192A1 (en) | Method for configuring data processing equipment | |
EP3776257B1 (en) | Object database for business modelling with improved data security | |
EP3583520B1 (en) | Method of operating a data storage system, computer program for implementing the method and data storage system operating according to the method | |
DE19908866C1 (en) | Software system transfer method has hardware parameters of configuration data for software system specific to first hardware platform replaced by hardware parameters specific to second hardware platform | |
EP4246326B1 (en) | Method, apparatus and system for real-time process monitoring | |
EP2136303B1 (en) | Method for controlling an automatic update of data views in a computer system | |
DE19951756B4 (en) | Data management method and computer program and system for executing it | |
DE102006037968B4 (en) | Universal and extensible data management with observation and inter-process communication mechanisms | |
DE102020112638A1 (en) | Process and processing unit for the automated finding and assignment of domains | |
DE19807436B4 (en) | System and method for controlling and monitoring programs in a computer network | |
CH720185A2 (en) | Procedure for writing records to a relational database |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
OM8 | Search report available as to paragraph 43 lit. 1 sentence 1 patent law | ||
R012 | Request for examination validly filed |
Effective date: 20130109 |
|
R016 | Response to examination communication | ||
R016 | Response to examination communication | ||
R079 | Amendment of ipc main class |
Free format text: PREVIOUS MAIN CLASS: G06F0017300000 Ipc: G06F0016000000 |
|
R018 | Grant decision by examination section/examining division | ||
R081 | Change of applicant/patentee |
Owner name: LUFTHANSA SYSTEMS GMBH, DE Free format text: FORMER OWNER: LRS LUFTHANSA REVENUE SERVICES GMBH, 22844 NORDERSTEDT, DE Owner name: LUFTHANSA SYSTEMS GMBH & CO. KG, DE Free format text: FORMER OWNER: LRS LUFTHANSA REVENUE SERVICES GMBH, 22844 NORDERSTEDT, DE |
|
R082 | Change of representative |
Representative=s name: WSL PATENTANWAELTE PARTNERSCHAFT MBB, DE |
|
R020 | Patent grant now final | ||
R081 | Change of applicant/patentee |
Owner name: LUFTHANSA SYSTEMS GMBH, DE Free format text: FORMER OWNER: LUFTHANSA SYSTEMS GMBH & CO. KG, 65479 RAUNHEIM, DE |