]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
gmysql get-order-after-query was ^%0@^* slow 4060/head
authorKees Monshouwer <mind04@monshouwer.org>
Tue, 21 Jun 2016 16:23:10 +0000 (18:23 +0200)
committermind04 <mind04@monshouwer.org>
Tue, 21 Jun 2016 17:58:11 +0000 (19:58 +0200)
modules/gmysqlbackend/gmysqlbackend.cc

index 66da8041fa44aa0faa0473876ade8c1f0032cd6b..ad9ed60d905650a62ba67ce83b2197381bbb7f40 100644 (file)
@@ -82,7 +82,7 @@ public:
 
     declare(suffix, "get-order-first-query", "DNSSEC Ordering Query, first", "select ordername, name from records where domain_id=%d and disabled=0 and ordername is not null order by 1 asc limit 1");
     declare(suffix, "get-order-before-query", "DNSSEC Ordering Query, before", "select ordername, name from records where ordername <= '%s' and domain_id=%d and disabled=0 and ordername is not null order by 1 desc limit 1");
-    declare(suffix, "get-order-after-query", "DNSSEC Ordering Query, after", "select min(ordername) from records where ordername > '%s' and domain_id=%d and disabled=0 and ordername is not null");
+    declare(suffix, "get-order-after-query", "DNSSEC Ordering Query, after", "select ordername from records where ordername > '%s' and domain_id=%d and disabled=0 and ordername is not null order by 1 asc limit 1");
     declare(suffix, "get-order-last-query", "DNSSEC Ordering Query, last", "select ordername, name from records where ordername != '' and domain_id=%d and disabled=0 and ordername is not null order by 1 desc limit 1");
     declare(suffix, "set-order-and-auth-query", "DNSSEC set ordering query", "update records set ordername='%s',auth=%d where name='%s' and domain_id='%d' and disabled=0");
     declare(suffix, "set-auth-on-ds-record-query", "DNSSEC set auth on a DS record", "update records set auth=1 where domain_id='%d' and name='%s' and type='DS' and disabled=0");