Commit 6cdeffca authored by Michael Ott's avatar Michael Ott
Browse files

Reverse ordering of dcdb.sensordata table for better ScyllaDB performance and...

Reverse ordering of dcdb.sensordata table for better ScyllaDB performance and reverse it again in libdcdb to retain the original ordering
parent 8e92626a
......@@ -531,6 +531,7 @@ bool ConnectionImpl::initSchema() {
createColumnFamily(CF_SENSORDATA,
"sid varchar, ws smallint, ts bigint, value bigint",
"sid, ws, ts",
"CLUSTERING ORDER BY (ws DESC, ts DESC) AND "
"COMPACT STORAGE AND gc_grace_seconds = " SENSORDATA_GC_GRACE_SECONDS
" AND compaction = " SENSORDATA_COMPACTION);
}
......@@ -540,6 +541,7 @@ bool ConnectionImpl::initSchema() {
createColumnFamily(CF_VIRTUALSENSORS,
"sid varchar, ws smallint, ts bigint, value bigint",
"sid, ws, ts",
"CLUSTERING ORDER BY (ws DESC, ts DESC) AND "
"COMPACT STORAGE AND gc_grace_seconds = " SENSORDATA_GC_GRACE_SECONDS
" AND compaction = " SENSORDATA_COMPACTION);
}
......
......@@ -317,6 +317,7 @@ void SensorDataStoreImpl::query(std::list<SensorDataStoreReading>& result, const
cass_statement_free(statement);
cass_prepared_free(prepared);
result.reverse();
}
/**
......@@ -445,6 +446,7 @@ void SensorDataStoreImpl::query(std::list<SensorDataStoreReading>& result, const
}
cass_prepared_free(prepared);
result.reverse();
}
/**
......@@ -508,6 +510,7 @@ void SensorDataStoreImpl::fuzzyQuery(std::list<SensorDataStoreReading>& result,
cass_statement_free(statement);
cass_future_free(future);
cass_prepared_free(prepared);
result.reverse();
}
/**
......@@ -603,6 +606,7 @@ void SensorDataStoreImpl::fuzzyQuery(std::list<SensorDataStoreReading>& result,
}
}
cass_prepared_free(prepared);
result.reverse();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment