Browse code

db_redis: do not print full table scan warning when loading the entire table

- GH #2149

Daniel-Constantin Mierla authored on 26/11/2019 08:14:42
Showing 1 changed files
... ...
@@ -1451,11 +1451,15 @@ static int db_redis_perform_query(const db1_con_t* _h, km_redis_con_t *con, cons
1451 1451
     RES_COL_N(*_r) = _nc;
1452 1452
 
1453 1453
     if (!(*keys_count) && do_table_scan) {
1454
-        LM_WARN("performing full table scan on table '%.*s' while performing query\n",
1454
+        if(_n > 0) {
1455
+            LM_WARN("performing full table scan on table '%.*s' while doing the query\n",
1455 1456
                 CON_TABLE(_h)->len, CON_TABLE(_h)->s);
1456
-        for(i = 0; i < _n; ++i) {
1457
-            LM_WARN("  scan key %d is '%.*s'\n",
1458
-                    i, _k[i]->len, _k[i]->s);
1457
+            for(i = 0; i < _n; ++i) {
1458
+                LM_WARN("  scan key %d is '%.*s'\n",
1459
+                        i, _k[i]->len, _k[i]->s);
1460
+            }
1461
+        } else {
1462
+            LM_DBG("loading full table: '%.*s\n", CON_TABLE(_h)->len, CON_TABLE(_h)->s);
1459 1463
         }
1460 1464
         if (db_redis_scan_query_keys(con, CON_TABLE(_h), _n,
1461 1465
                     keys, keys_count,