Permalink
Browse files

removed searching for key columns, because the property is not used, …

…and it causes performance problems with large data sets
  • Loading branch information...
1 parent 80c86d3 commit 2936143d41090edb89c8430fcbea063716a7e74b @nberardi nberardi committed Jul 6, 2012
Showing with 1 addition and 11 deletions.
  1. +0 −2 src/CassandraColumnSchema.cs
  2. +1 −9 src/CassandraCqlRowSchema.cs
@@ -19,8 +19,6 @@ public CassandraColumnSchema(ColumnDef def, CassandraType columnNameType)
ValueType = CassandraType.GetCassandraType(def.Validation_class);
}
- public bool IsKey { get; set; }
-
private CassandraObject _name;
public CassandraObject Name
{
@@ -19,7 +19,6 @@ public CassandraCqlRowSchema(CqlResult result, string familyName)
#endif
var def = result.Schema;
- var sampleRow = result.Rows.FirstOrDefault();
var colNameType = CassandraType.GetCassandraType(def.Default_name_type);
var colValueType = CassandraType.GetCassandraType(def.Default_value_type);
@@ -29,7 +28,6 @@ public CassandraCqlRowSchema(CqlResult result, string familyName)
Columns = new List<CassandraColumnSchema>();
var colNameTypes = new Dictionary<CassandraObject, CassandraType>();
- var keyColNames = new List<CassandraObject>();
foreach (var c in def.Name_types)
{
@@ -39,26 +37,20 @@ public CassandraCqlRowSchema(CqlResult result, string familyName)
colNameTypes.Add(name, type);
}
- // sample row to find key names
- if (sampleRow != null)
- keyColNames = sampleRow.Columns.Where(x => x.Ttl == -1).Select(x => CassandraObject.GetCassandraObjectFromDatabaseByteArray(x.Name, CassandraType.BytesType)).ToList();
-
// columns returned
foreach (var c in def.Value_types)
{
var type = CassandraType.GetCassandraType(c.Value);
var nameType = colNameType;
var name = CassandraObject.GetCassandraObjectFromDatabaseByteArray(c.Key, CassandraType.BytesType);
- var isKey = keyColNames.Contains(name);
if (colNameTypes.ContainsKey(name))
nameType = colNameTypes[name];
var colSchema = new CassandraColumnSchema {
NameType = nameType,
Name = name,
- ValueType = type,
- IsKey = isKey
+ ValueType = type
};
Columns.Add(colSchema);

0 comments on commit 2936143

Please sign in to comment.