You should have al look at the execution plan for your query.
The Part "SPS_Node=%d AND Typ=%d AND Element=%d" can use the primary key index for "Kommt IS NOT NULL AND Geht IS NULL" there is no index available. In May be the case that optimizer decides not to use index at all.
You should try to materialize "Kommt IS NOT NULL AND Geht IS
NULL" to an additional Column (e.g. "offen") type small int which
is 1 on condition true and 0 otherwise.
This allows an Index in "SPS_NODE,TYP,ELEMENT,OFFEN" and your query becomes
UPDATE alarme SET Geht=''%s'', Quittiert=''%s'' WHERE (SPS_Node=%d AND Typ=%d AND Element=%d AND Offen=1)
which should definitely use the index created.
--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/0e665278-5f4c-45d5-a520-8c048d9e2f54n%40googlegroups.com.
-- Mit freundlichen Grüßen Elmar Haneke =========================================================== |Dr. Elmar Haneke Tel: +49-2241-39749-0 | | Fax: +49-2241-39749-30| |Haneke Software WWW: www.haneke.de | |Dr. Elmar und Hubertus Haneke Mail: el...@haneke.de | |Johannesstraße 41 | |53721 Siegburg USt-IdNr. DE 123387209| ===========================================================
Hi
Your PK is „SPS_NODE,TYP,ELEMENT,KOMMT”
And your update work on the part of it „SPS_NODE,TYP,ELEMENT”.
Then the main question is how many records are updated during such slow update?
And any triggers ON UPDATE on this table?
Regards,
Karol Bieniaszewski
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/3779f79a-0eae-4434-b8af-24f84b8b8892n%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/bc25051d-a80f-4f5b-8c63-a064b3ce80edn%40googlegroups.com.