Tag Info

Hot answers tagged

8

EAV is not evil; like any other tool, it can be implemented poorly and abused. You can find articles trash talking cursors, dynamic SQL, triggers, even SQL Server itself. That doesn't make them bad things. EAV can be an appropriate solution. Whether it's the right answer in your specific case is probably more opinion-based than anything; I'm answering more ...


3

I have an EAV for tracking server / database configuration. It's great for getting data in. We can throw any data at it and the loader ensures the "E" and the "A" reflect the data given. Once we got over a few hundred million rows in the Values table, however, getting data out became increasingly problematic. (I think having 400-column PIVOT queries ...


2

I echo the "bad form" comment of @JohnM - design the thing properly, and if you have new requirements (or your design isn't perfect first time - unlikely I know :-) ), then choose to add new fields. Use JSON if it suits your clearly demonstrated requirements, otherwise stick with "normal" field types. I've seen too many systems where these "spare fields" ...


2

If you're running Enterprise edition, you can add and remove indices, including clustered indices, with ONLINE. Since your existing PK isn't being used, you can start by dropping it. Then create your new clustered index, and finally drop your old non-clustered index which is now obsolete. ALTER TABLE MyTable DROP CONSTRAINT PK_MyTbl_SrgKey WITH ...


1

You could use inheritance for this. You would have a "master" schema with template tables and only the basic set of columns that all inheriting tables share: CREATE TABLE master.portal(portal_name text); All other tables in various schemata inherit from it, while possibly adding more local columns: CREATE TABLE a.portal(portal_id serial PRIMARY KEY, col2 ...


1

No. The reason why database designers are interested in FDs is because they are a formalisation of Business Rules - rules about the data which accurately reflect the Business Domain to be modelled in the database. The only sound and practical way to identify FDs is by analysing and understanding a set of business requirements. Suppose you are designing a ...



Only top voted, non community-wiki answers of a minimum length are eligible