|
21 | 21 | import com.blobcity.db.bsql.BSqlCollectionManager; |
22 | 22 | import com.blobcity.db.bsql.BSqlIndexManager; |
23 | 23 | import com.blobcity.db.cache.QueryResultCache; |
| 24 | +import com.blobcity.db.features.FeatureRules; |
24 | 25 | import com.blobcity.db.lang.columntypes.FieldType; |
25 | 26 | import com.blobcity.db.schema.beans.SchemaManager; |
26 | 27 | import com.blobcity.db.schema.beans.SchemaStore; |
@@ -138,10 +139,12 @@ private String select(final String appId, CursorNode node, final String sqlStrin |
138 | 139 | } |
139 | 140 |
|
140 | 141 | /* Load query result from cache if present in cache */ |
141 | | - final String result = queryResultCache.get(sqlString); |
142 | | - if(result != null) { |
143 | | - logger.trace("Returning cached response for SQL query: " + sqlString); |
144 | | - return result; |
| 142 | + if(FeatureRules.QUERY_RESULT_CACHING) { |
| 143 | + final String result = queryResultCache.get(sqlString); |
| 144 | + if (result != null) { |
| 145 | + logger.trace("Returning cached response for SQL query: " + sqlString); |
| 146 | + return result; |
| 147 | + } |
145 | 148 | } |
146 | 149 |
|
147 | 150 | String schema = selectNode.getFromList().get(0).getTableName().getSchemaName(); |
@@ -356,7 +359,10 @@ private String produceResult(final String ds, final String collection, final Str |
356 | 359 | .put(BQueryParameters.PAYLOAD, result) |
357 | 360 | .put(BQueryParameters.TIME, executionTime) |
358 | 361 | .put(BQueryParameters.ROWS, result.size()).toString(); |
359 | | - queryResultCache.cache(ds, collection, sqlQuery, resultString); |
| 362 | + |
| 363 | + if(FeatureRules.QUERY_RESULT_CACHING) { |
| 364 | + queryResultCache.cache(ds, collection, sqlQuery, resultString); |
| 365 | + } |
360 | 366 |
|
361 | 367 | /* Register the number of rows selected for cloud billing purposes */ |
362 | 368 | if(!ds.equals(".systemdb")) { |
|
0 commit comments