Open carlganz opened 1 year ago
Thanks. Was this restriction lifted in SQL Server 2016? I'd rather avoid working around a limitation in a version that will reach end of life soon-ish.
I also don't understand how columnstore indexes are an alternative to keys.
We are using SQL Server 2017, and cannot add foreign keys because of the columnstore indexes. I was also perplexed by this, but maybe there is some way to extract the same relationships with the columnstore indexes (since presumably the SQL Server engine uses the columnstore to figure out these relationships or joins would be slower)
Thanks. If we can extract reliable information from the database, we can use it. I suspect that in this case this information is simply not available (joins can be made without the presence of FK constraints, it's the database's job to figure out the fastest way to do it). I'd consider a reproducible example that shows how to extract that info.
Alternatively, you can always define a function for your dm object that adds whatever keys are necessary.
In SQL Server 2014 they added columnstore indexes, which improves performance for datawarehouses, but doesn't allow foreign keys as a tradeoff (see discusssion: https://dba.stackexchange.com/questions/78694/clustered-columnstore-indexes-and-foreign-keys)
I would think the same relational information the keys contain would also be available in the index metadata using a query like:
I haven't dug too deep into the source code for
dm
, but does adding support for columnstore indexes as an alternative to keys seem feasible?