6,855 reputation
1923
bio website mooseware.ca
location Mississauga, Canada
age 52
visits member for 3 years, 5 months
seen 6 hours ago

I'm a professional software developer with more than twenty years of experience across many industries and the entire systems development lifecycle. I'm the principal consultant at Mooseware Limited.

@joelabrown

google

facebook

linkedin


17h
comment Product Attribute System While Avoiding EAV
I've discussed using EAV for product catalogs on Stack Overflow here: stackoverflow.com/questions/11779252/… - EAV is evil, except when it is actually the best approach. Attributes of products in a catalog is one where EAV is often the most efficient and suitable design.
Jan
27
comment Multiple user roles with different attributes
Your sections are connected, but your diagramming tool doesn't see it because you didn't define the referential integrity in your DDL (or your modeling tool) properly. Note that every specialty role has a key of user_id. This should be FK to Users.id. In other words, Users is a super-type and admins, employees, customers, etc. are all subtypes related 1:0,1 to the super-type.
Jan
27
comment linking a single table (comment) to multiple tables (article,link,attachment)?
This question was essentially asked yesterday, see: dba.stackexchange.com/questions/90137/… The linked question is about sharing addresses, but the same discussion applies to sharing comments, links, etc. etc.
Jan
26
answered Normalising shared entities and applying constraints
Jan
19
comment Design: how to store lots of booleans?
@AleksandrMakov - A "pure intersection" is a table containing only foreign keys that together make a composite primary key for the table. OBJECT_HAS_THING would be a pure intersection if the only columns in that table are my_object_id and ownable_thing_id and if both of these columns together are the primary key of the table. If you added a third column to this table, say has_one (bit) then it would no longer be a pure intersection.
Jan
19
comment Design: how to store lots of booleans?
@AleksandrMakov - If one of your major use cases is searching by a list of particular types of things that your object has, then using 300 bit columns will inevitably result in table scans, so your query performance will has tortoise as it were. Depending on how many of your ownable things a typical object has (i.e. if the average number is much less than 300) then you are probably better off using the pure intersection rather than a fully populated intersection with a bit flag. Treat the absence of a link record as "not owned". This will be at least as performant as 300 bit flags.
Jan
19
answered Design: how to store lots of booleans?
Jan
19
comment what is better, multiple column or multiple rows while schema design
Third normal form is your friend. You should read up about the normal forms and design your transactional tables around 3NF (or higher, if applicable). Denormalize along the lines of your first table design for reporting purposes, if necessary for performance reasons or for purposes of having a stable snapshot.
Jan
18
answered Designing a High Score/Leaderboard table
Jan
5
comment what is a good use case for splitting user table by role
@user20358 Yes, a view won't save anything in terms of read performance, unless you materialize the view. However, the cost of reading through the view is very likely to be negligible. The greater issue is more likely to be maintainability of your code.
Jan
4
answered what is a good use case for splitting user table by role
Dec
17
answered database design for storing individual users' items
Dec
6
answered Suitable way to record users requests for usage invoicing/billing in database?
Nov
16
comment Advice on table structure change
Since your scores are all mandatory, there probably isn't a resource-usage argument to be made for splitting them out. You could make a future-proofing argument for splitting scores/comments into an intersection table between BOXSUPERVISION and SCORE_TYPE or the like.
Nov
16
revised Advice on table structure change
Reformatted markdown and text to be more readable.
Nov
16
comment When using underscores, should they be reserved to junction tables?
Name your tables so that the names make sense in queries. Use the closest thing to your organization's natural business language that is practical. An intersection between USER and ROLE should be ROLE_MEMBER not USER_ROLE. Sometimes slamming the two referenced table names together with an underscore is the best you can do, but I almost always feel like I've failed if I resort to that.
Nov
13
comment Database Design for Paper Submission System
@IrfanAliMemon - I have posted a complete ERD. Note that primary key columns are underlined and foreign key columns are italicized. (In the CONTRIBUTION table, columns are in both roles.)
Nov
13
comment Database Design for Paper Submission System
You have misapprehended, somewhat, the intention of the CONTRIBUTION table and my repurposing of your SUBMISSION table. Please see my edited answer for clarity.
Nov
13
revised Database Design for Paper Submission System
Added more detailed ERD
Nov
12
comment Database Design for Paper Submission System
@IrfanAliMemon The Contribution table is a pure intersection. It would have a primary key that is composed of the combination of the two foreign keys to Submission and Author. There is no need for any other columns in the intersection table. New and revised submissions are implicitly related insofar as they are for the same Paper and therefore share the same foreign key value, e.g. PaperID.