Reputation
7,120
Top tag
Next privilege 10,000 Rep.
Access moderator tools
Badges
1 9 23
Newest
 Explainer
Impact
~153k people reached

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.
Nov
5
comment Database Design for Paper Submission System
@IrfanAliMemon In the ERD with four tables, SUBMISSION records the act of a paper being submitted. Assuming the editing process may sometimes involve rejection(s) and resubmission(s) this is 1:M with PAPER. For each such act of submitting a paper, there may be a different list of AUTHORs - which is M:N with SUBMISSION. This M:N relationship is resolved with the CONTRIBUTION table.
Nov
4
comment How to insert values in junction table for many to many relationships?
@xyz Having implicit COMMIT is not the same thing as never having or wanting to control you transaction scope. When you are writing into multiple tables in a single logical unit of work you will want to control your transactions explicitly
Nov
3
reviewed Approve Are bitemporal tables convenient, compared to valid-time and transaction-time tables separately?
Nov
3
answered Composite Foreign key to single primary key
Nov
2
revised Preventing duplicate data when usual normalization only makes sense for some of the records
Expanded and clarified.