Einzelnen Beitrag anzeigen

Benutzerbild von haentschman
haentschman

Registriert seit: 24. Okt 2006
Ort: Seifhennersdorf / Sachsen
5.297 Beiträge
 
Delphi 12 Athens
 
#6

AW: Firebird Leistung Index IBExpert

  Alt 2. Mai 2014, 08:11
Danke an alle erst mal.

Gerade gefunden:
http://www.firebirdfaq.org/faq205/
Zitat:
Why doesn't MAX(Primary key field) use index?

It's because primary keys are enforced using ascending index and MAX only uses descending index. For example, if you try to get MIN(PK) it would use the index. If you often have queries using MAX, it is a good idea to create another, DESCENDING index on PK column.
Toll zu wissen...

Nach der Änderung und Neuberechnung des Index:
SQL
select max(F_timestamp_unix) from t_record_data
Delphi-Quellcode:
------ Leistungsinformation ------
Prepare time = 31ms
Ausführungszeit = 0ms
Avg fetch time = 0,00 ms
Current memory = 17.897.528
Max memory = 70.260.896
Memory buffers = 1.024
Reads from disk to cache = 5
Writes from cache to disk = 0
Fetches from cache = 9
Das hat mich einen ganzen Tag gekostet.

Danke für die Tipps zum Brille putzen.

Zitat:
Da Du "select top 10" machst, scheint ja allein das Maximum schon relativ häufig vorhanden zu sein, so dass Du es einschränkst. Oder erhoffst Du Dir davon einfach nur den Server etwas zu schonen?
... in diesem Falle existieren je Timestamp zwischen 13 und 30 Parameter. War eher auch zum Testen.

Geändert von haentschman ( 2. Mai 2014 um 08:15 Uhr)
  Mit Zitat antworten Zitat