Low Cardinality Indexes & Red/Black Tree Index LINQ to CSLA

Low Cardinality Indexes & Red/Black Tree Index LINQ to CSLA

Old forum URL: forums.lhotka.net/forums/t/5822.aspx


Jack posted on Tuesday, November 18, 2008

I do a lot of filtering based on Y/N or 1/0 indicators - I just wanted to confirm that a Red/Black tree index is just a balanced tree of the unique values that essentially points to a bucket of underlying objects?  So the cardinality is not really an issue.

Thanks

Jack

RockfordLhotka replied on Wednesday, November 19, 2008

I don't think you'd want to use Indexable on such properties.

A RB tree is just a balanced binary tree, using the property value as an indexer. So if your property values are just T/F or 0/1 then you'll have a horribly distorted tree and you might as well avoid the indexing overhead and just allow any query to do a linear scan of the collection (because that's about all you'd get anyway).

Copyright (c) Marimer LLC