Tag Info

Hot answers tagged

5

Imagine you are out with a group of friends and the conversation turns to movies. Someone asks, "What did you think of 'The Three Musketeers'?" You respond, "Which one?" What additional information would you need to be absolutely certain you are both thinking of the same movie? The director's name? The production studio? The year it was released? One of the ...


4

Your table definition looks reasonable all over now. With all columns NOT NULL the UNIQUE constraint will work as expected - except for typos and minor differences in spelling, which may be rather common I am afraid. Consider @a_horse's comment. Alternative with functional unique index The other option would be a functional unique index (similar to what ...


4

You can generate a customized index table, for example, that has a row for all year&week pairs that the date range (a certain vacation etc) encompasses. Then you can join dateranges by going through that index table. It will be large, but does avoid large scans as you can just list all vacations that have any weeks that are in common with another ...


2

I want to distinguish carefully between analysis and design. You analyze the subject matter in order to "make sense" out of each of the values to be stored in the database. You design the database in order to come up with the containers (tables) and linkages (foreign keys) that make the database functional and hold the values you discovered during ...


2

Overlapping date ranges can be found thus WHERE FromDate <= QToDate AND ToDate >= QFromDate You will get one row returned for each partially or fully overlapping range. For example, if you had separate pay rates for morning, afternoon and evening shifts and someone worked all three, there would be three rows returned. The same basic pattern ...


2

Just adding files to the existing file group will not redistribute the existing data. I would go the route @Max is suggesting and ensure that the new files you are creating are the same size to maximize the proportional fill feature. And before you begin take a full backup. Once you've migrated all of the tables, indexes, etc over to the new file group ...


1

I think the first solution is good when you know that some instances WOULD NOT participate in relation. But what about second solution? I think it's good when you're sure that all of the instances WOULD participate in relation. The first thing you can do, is analyzing your Problem.


1

I don't know what your professor has really said I am not sure if I understand your model. But maybe the following is interesting. In the article A Logical Design Methodology for Relational Databases Using the Extended Entity-Relationship Model by T.J Teory, D. Yang and J.P. Fry is described how entity relationship diagrams can be transformed to relations ...


1

Learn Table Inheritance (aka subtype/supertype) Individual : Legal Party (":" meaning "inherits") Organization : Legal Party Email : Address Phone : Address MailingAddress : Address WebURL : Address LegalParty -< PartyRelationships >- LegalParty LegalParty -< ContactInfo >- Address Read up on existing data model ...


1

The problem with a FromDate / ToDate format is that the query generates an index scan. For example, a staff member takes vacation and returns two weeks later. ID FromDate ToDate 15 2011-01-03 2011-01-17 Imagine many staff members, some with 20 or 30 years of such work history, maybe taking only a day or two at a time several times each year. ...


1

It looks like you changed the context of the /mnt/db/pg_data directory, but didn't apply the changes to everything underneath. You can verify this by running ls -Z on the files in question. If you don't see 'postgresql_db_t', then the changes weren't applied. restorecon -Rv /mnt/db/pg_data/ should set the SELinux contexts correctly. Forcing a relabel of ...



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