18
bbi Software AG Lothar Flatz Senior Principal Consultant Software & Informatik Hardware versus Brainware

Hardware versus Brainware - InfoNet Day · 2016-11-07 · environment in Linux REDHAT5, and now the query is very slow. I checked toad monitor, it said need to increase db_buffer_cache

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Hardware versus Brainware - InfoNet Day · 2016-11-07 · environment in Linux REDHAT5, and now the query is very slow. I checked toad monitor, it said need to increase db_buffer_cache

bbi Software AG

Lothar Flatz

Senior Principal Consultant

Software & Informatik

Hardware versus Brainware

Page 2: Hardware versus Brainware - InfoNet Day · 2016-11-07 · environment in Linux REDHAT5, and now the query is very slow. I checked toad monitor, it said need to increase db_buffer_cache

bbi Software AG

Wer bin ich?

über 25 Jahre Oracle Database Erfahrung(beginnend mit Version 5)

15 jahre Oracle Mitarbeiter

Oak Table Mitglied

Ex-Real World Performance Group

Oracle ACE

Signatur Project: PVSS (CERN)

Patent US 8103658 B2 zusammen mit Björn Engsig

Anatomie eines SQL Befehls

Ich stelle mich vor ...

Page 3: Hardware versus Brainware - InfoNet Day · 2016-11-07 · environment in Linux REDHAT5, and now the query is very slow. I checked toad monitor, it said need to increase db_buffer_cache

bbi Software AG

bbi Software AG

• Gründung 1994

• Rechtsform Aktiengesellschaft in privater Hand

• Standorte Baar ZG und Oberdorf SO

• Angestellte 10 Mitarbeitende

• Zertifizierung SQS Zertifiziertes Managementsystem ISO 9001

• Software Beschaffung, Lizenz Management, Software Paketierung, Beratung, Enterprise Reporting

Page 4: Hardware versus Brainware - InfoNet Day · 2016-11-07 · environment in Linux REDHAT5, and now the query is very slow. I checked toad monitor, it said need to increase db_buffer_cache

bbi Software AG

Arbeit an

Performance Problemen

Keine gesalzenen Bananen bitte!

Page 5: Hardware versus Brainware - InfoNet Day · 2016-11-07 · environment in Linux REDHAT5, and now the query is very slow. I checked toad monitor, it said need to increase db_buffer_cache

bbi Software AG

„We just migrated to a new devenvironment in Linux REDHAT5, and now the query is very slow.

I checked toad monitor, it said need to increase db_buffer_cache and shared pool too small.“

Typische Anfrage auf OTN

Keine gesalzenen Bananen bitte!

Page 6: Hardware versus Brainware - InfoNet Day · 2016-11-07 · environment in Linux REDHAT5, and now the query is very slow. I checked toad monitor, it said need to increase db_buffer_cache

bbi Software AG

Typical Antwort

“If you want more help here, let's start with some DATA. Without this, people here can only guess at the actual cause of your problem, although if enough of us guess for a long enough time, somebody will undoubtedly find the right answer eventually.”

Senior DBA, Calagry

Anatomie eines SQL Befehls

Page 7: Hardware versus Brainware - InfoNet Day · 2016-11-07 · environment in Linux REDHAT5, and now the query is very slow. I checked toad monitor, it said need to increase db_buffer_cache

bbi Software AG

Reaktion des IT Management

Keine gesalzenen Bananen bitte!

Page 8: Hardware versus Brainware - InfoNet Day · 2016-11-07 · environment in Linux REDHAT5, and now the query is very slow. I checked toad monitor, it said need to increase db_buffer_cache

bbi Software AG 8

Keine gesalzenen Bananen bitte!

Ein Witz, der den Geist anregt

Page 9: Hardware versus Brainware - InfoNet Day · 2016-11-07 · environment in Linux REDHAT5, and now the query is very slow. I checked toad monitor, it said need to increase db_buffer_cache

bbi Software AG 9

Praktisch erprobt

Oft verwendet zur Optimierung von Join Reihenfolgen

oder Index Optimierung

Nur eine Datenzeile wird behalten

Keine gesalzenen Bananen bitte!

Was ist «throw away»?

Page 10: Hardware versus Brainware - InfoNet Day · 2016-11-07 · environment in Linux REDHAT5, and now the query is very slow. I checked toad monitor, it said need to increase db_buffer_cache

bbi Software AG 10

Kommt oft im call center vor

Man findet immer viele Datensätze, egal wo man die Suche beginnt

Die Schnittmenge ist klein

Der grösste Teil der gelesenen Datensätze wird weggeworfen

Keine gesalzenen Bananen bitte!

Eine harte Nuss

Page 11: Hardware versus Brainware - InfoNet Day · 2016-11-07 · environment in Linux REDHAT5, and now the query is very slow. I checked toad monitor, it said need to increase db_buffer_cache

bbi Software AG 11

Das wäre der natürliche Ansatz

Die Suchkriterien sind auf unterschiedlichen Tabellen

Kombinierte Suche praktisch schwierig

Person Address

Keine gesalzenen Bananen bitte!

Suchkriterien kombinieren?

Page 12: Hardware versus Brainware - InfoNet Day · 2016-11-07 · environment in Linux REDHAT5, and now the query is very slow. I checked toad monitor, it said need to increase db_buffer_cache

bbi Software AG 12

fast refresh materialized view

Brauchen Rechte und zusätzlichen Platz

fast refresh kritisch im OLTP

bitmap join index

die selben Nachteile wie eine materialized View

zusätzlich noch locking problematisch

text index

“exotische” Lösung

Programmänderung erforderlich wegen anderer Suchoperatoren

Mühsame Aktualisierung

Keine gesalzenen Bananen bitte!

Lösungsansätze kombinierte Suche

Page 13: Hardware versus Brainware - InfoNet Day · 2016-11-07 · environment in Linux REDHAT5, and now the query is very slow. I checked toad monitor, it said need to increase db_buffer_cache

bbi Software AG

Index findet man eher im Speicher als Tabellen

Die Index Blöcke haben meist eine bessere hit ratio als Tabellen Blöcke

Index Einträge sind meist kleiner als die zugehörigen Datensätze

Index Einträge sind nach dem Suchbegriff geclusteret

Der Tabellenzugriff erzeugt 19 mal mehr physischen I/O als der Index Zugriff

13

Keine gesalzenen Bananen bitte!

Index / Tabelle im Cache

Page 14: Hardware versus Brainware - InfoNet Day · 2016-11-07 · environment in Linux REDHAT5, and now the query is very slow. I checked toad monitor, it said need to increase db_buffer_cache

bbi Software AG 14

+

=

Keine gesalzenen Bananen bitte!

Warum lesen, was man wegwerfen wird ?

Page 15: Hardware versus Brainware - InfoNet Day · 2016-11-07 · environment in Linux REDHAT5, and now the query is very slow. I checked toad monitor, it said need to increase db_buffer_cache

bbi Software AG 15

Keine gesalzenen Bananen bitte!

select * from (

select a.city_name, p.last_name, substr(p.data,1,1) p_data,

substr(a.data,1,1) a_data

from ibj.person p,

ibj.address a,

(select /*+ NO_MERGE */ p.rowid p_rowid,

a.rowid a_rowid

from ibj.address a,

ibj.person p

where p.person_id = a.person_id

and a.city_name = 'Bern'

and p.last_name = 'Müller'

) i

where i.p_rowid = p.rowid

and i.a_rowid = a.rowid)

where rownum < 11

/

Simulierter Index Backbone Join

Page 16: Hardware versus Brainware - InfoNet Day · 2016-11-07 · environment in Linux REDHAT5, and now the query is very slow. I checked toad monitor, it said need to increase db_buffer_cache

bbi Software AG 16

Keine gesalzenen Bananen bitte!

Nur ein Traum ?

Page 17: Hardware versus Brainware - InfoNet Day · 2016-11-07 · environment in Linux REDHAT5, and now the query is very slow. I checked toad monitor, it said need to increase db_buffer_cache

bbi Software AG 17

Und es geht doch …„My favorite new Oracle Database 12c feature is the SQL Translation Framework. I might be able to use it to fix badly written SQL behind the scenes.”

Kerry Osborne,CTO Eniktec,Oak Table Member

Keine gesalzenen Bananen bitte!

Page 18: Hardware versus Brainware - InfoNet Day · 2016-11-07 · environment in Linux REDHAT5, and now the query is very slow. I checked toad monitor, it said need to increase db_buffer_cache

bbi Software AG 18

bbi Software AG

Ruessenstrasse 12

6340 Baar ZG (Switzerland)

Phone: +41 (0)41 511 44 00

Direct: +41 (0)78 626 43 31

Fax: +41 (0)41 511 44 07

mailto:[email protected]

http://www.bbi.ch

Anatomie eines SQL Befehls