Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
What benefits (or the opposite) might come from defining those columns as FOREIGN KEYs? I am particularly interested if there's any potential performance gain.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
I guess by saying performance is irrelevant, you mean that the FOREIGN KEY constraint will have no effect on performance. I hope that's what you mean, rather than that performance as a topic is irrelevant; in this part of my application, almost nothing is more relevant than performance
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
This database-backed code is a replacement for an earlier file-backed code. At the moment, the database-backed code is more a low-level reworking of the file-backed code, just using the database as a byte store. It is hoped to take the next step, to more like a "proper" database application, in the medium term.
Unfortunately, in several circumstances, it is slower. Hence my focus on performance.
The main reason for two separate tables is to save space. If the data that was in table A (the one with the tokens as the primary key) was moved to table B, it would be massively duplicated. A lot of rows of B refer to the same row of A.
The database is fully embedded in the application and managed by a small part of the overall code. The responsibilty for ensuring tables A and B are consistent lies with that code. No other code, and certainly no arbitrary remote clients, get to change the data in the database.
Originally posted by Paul Sturrock:
Fair enough - if you have complete control of the data model you can assume it will remain consistant. Again though if the data model is not shared are you sure a relational database is the best fit for your requirement?
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Originally posted by Peter Chase:
Lucene's just for text, isn't it? Much of this data isn't text and many likely searches are things like date ranges, page counts etc.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Originally posted by Kaydell Leavitt:
For example, to implement the relationship between Vendors and Items -- which is many-to-many, there would be a link file, containing the hidden ID or the Item and the hidden ID of the Vendor.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
With ON UPDATE CASCADE, I think that one issue is that records that are external to your organization can't be changed. Records like invoices and purchase orders can't be changed because they are legal records.
Is the time it takes to do the cascaded update proportional to the number of records to be updated?
Or is a FOREIGN KEY essentially the same thing as the hidden ID concept.
With ON UPDATE CASCADE, I think that one issue is that records that are external to your organization can't be changed. Records like invoices and purchase orders can't be changed because they are legal records.
I don't follow this. What do you mean "external to your organization"? Outside your database? If you don't want child records to be changed by an update to their parent, don't use ON UPDATE CASCADE.
FOREIGN KEY is a constraint, not a column.
It says that the value in column X of table A is a key into column Y in table B. Column X and column Y must have compatible types, or the constraint cannot be created.
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |