denormalization

Storing multiple choice values in database

倖福魔咒の 提交于 2019-11-27 06:26:02
问题 Say I offer user to check off languages she speaks and store it in a db. Important side note, I will not search db for any of those values, as I will have some separate search engine for search. Now, the obvious way of storing these values is to create a table like UserLanguages ( UserID nvarchar(50), LookupLanguageID int ) but the site will be high load and we are trying to eliminate any overhead where possible, so in order to avoid joins with main member table when showing results on UI, I

When to Denormalize a Database Design

江枫思渺然 提交于 2019-11-27 02:43:52
I know that normalis(z)ation has been extensively discussed on Stack Overflow. I've read many of the previous discussions. I've got some additional questions though. I'm working on a legacy system with at least 100 tables. The database is has some un-normalized structure, tables that contain a variety of disparate data, and other problems. I've been given the task of trying to improve it. I can't just start again but need to modify the existing schema. In the past I have always tried to design normalized databases. Now the questions. A senior developer has suggested that in some cases we can't

Denormalize nested structure in objects with symfony 2 serializer

风流意气都作罢 提交于 2019-11-27 02:43:10
问题 I'm working on Symfony 2 project with version 2.8 and I'm using the build-in component Serializer -> http://symfony.com/doc/current/components/serializer.html I have a JSON structure provided by a web service. After deserialization, I want to denormalize my content in objects. Here is my structure (model/make in a car application context). [{ "0": { "id": 0, "code": 1, "model": "modelA", "make": { "id": 0, "code": 1, "name": "makeA" } } } , { "1": { "id": 1, "code": 2, "model": "modelB",

How to normalize / denormalize a vector to range [-1;1]

99封情书 提交于 2019-11-27 01:09:21
How can I normalize a vector to the range [-1;1] I would like to use function norm , because it will be faster. Also let me know how I can denormalize that vector after normalization ? norm normalizes a vector so that its sum of squares are 1. If you want to normalize the vector so that all its elements are between 0 and 1, you need to use the minimum and maximum value, which you can then use to denormalize again. %# generate some vector vec = randn(10,1); %# get max and min maxVec = max(vec); minVec = min(vec); %# normalize to -1...1 vecN = ((vec-minVec)./(maxVec-minVec) - 0.5 ) *2; %# to "de

How do I periodically rebuild a reporting table that is very frequently accessed?

拜拜、爱过 提交于 2019-11-26 20:31:06
问题 It takes about 5-10 minutes to refresh a prepared reporting table. We want to refresh this table constantly (maybe once every 15 minutes or continuously). We query this reporting table very frequently (many times per minute) and I can't keep it down for any length of time. It is okay if the data is 15 minutes old. I can't drop the table and recreate it. I can't delete the table's contents and recreate it. Is there a technique I should be using, like swapping between two tables (read from one

In what way does denormalization improve database performance?

 ̄綄美尐妖づ 提交于 2019-11-26 17:55:46
问题 I heard a lot about denormalization which was made to improve performance of certain application. But I've never tried to do anything related. So, I'm just curious, which places in normalized DB makes performance worse or in other words, what are denormalization principles? How can I use this technique if I need to improve performance? 回答1: Denormalization is a time-space trade-off. Normalized data takes less space, but may require join to construct the desired result set, hence more time. If

How to normalize / denormalize a vector to range [-1;1]

此生再无相见时 提交于 2019-11-26 12:26:43
问题 How can I normalize a vector to the range [-1;1] I would like to use function norm , because it will be faster. Also let me know how I can denormalize that vector after normalization ? 回答1: norm normalizes a vector so that its sum of squares are 1. If you want to normalize the vector so that all its elements are between 0 and 1, you need to use the minimum and maximum value, which you can then use to denormalize again. %# generate some vector vec = randn(10,1); %# get max and min maxVec = max

When to Denormalize a Database Design

风格不统一 提交于 2019-11-26 10:08:31
问题 I know that normalis(z)ation has been extensively discussed on Stack Overflow. I\'ve read many of the previous discussions. I\'ve got some additional questions though. I\'m working on a legacy system with at least 100 tables. The database is has some un-normalized structure, tables that contain a variety of disparate data, and other problems. I\'ve been given the task of trying to improve it. I can\'t just start again but need to modify the existing schema. In the past I have always tried to