rdbms

Overnormalization

狂风中的少年 提交于 2019-11-27 11:11:32
问题 When would a database design be described as overnormalized? Is this characterization an absolute one? Or is it dependent on the way it is used in the application? Thanks. 回答1: In the general sense, I think that overnormalized is when you are doing so many JOINs to retrieve data that it is causing notable performance penalties and deadlocks on your database, even after you've tuned the heck out of your indexes. Obviously, for huge applications and sites like MySpace or eBay, de-normalization

Why NoSQL is better at “scaling out” than RDBMS?

二次信任 提交于 2019-11-27 11:03:16
I have read the following text in a technical blog discussing the advantages and disadvantages of NoSQL " For years, in order to improve performance on database servers, database administrators have had to buy bigger servers as the database load increases (scaling up) instead of distributing the database across multiple “hosts” as the load increases (scaling out). RDBMS do not typically scale out easily, but the newer NoSQL databases are actually designed to expand easily to take advantage of new nodes and are usually designed with low-cost commodity hardware in mind. " I became confused about

How to get the byte size of resultset in an SQL query?

岁酱吖の 提交于 2019-11-27 08:21:15
Is it possible to get the size in bytes of the results of an sql query in MySQL? For example: select * from sometable; ths returns 10000 rows. I don't want the rows but the size of the resultset in bytes. Is it possible? select sum(row_size) from ( select char_length(column1)+ char_length(column2)+ char_length(column3)+ char_length(column4) ... <-- repeat for all columns as row_size from your_table ) as tbl1; char_length for enum , set might not accurate, please take note To build on Angelin's solution, if your data contains nulls, you'll want to add IFNULL to each column: select sum( ifnull

Why don't DBMS's support ASSERTION

此生再无相见时 提交于 2019-11-27 07:48:45
So I recently learned about ASSERTION in my databases course, and my prof noted that major databases don't support it, even though it is in the SQL-92 standard. I tried googling to find out why, but there doesn't seem to be any discussion on the topic. So, why isn't ASSERTION supported by the vast majority of relational database packages? Is it soley a performance issue or is there something intrinsically hard about it? If you can, please note any database packages that implement it as well (example: if there's an academic/teaching DB). Also, why is there so little discussion on the issue; it

Which database systems support an ENUM data type, which don't?

空扰寡人 提交于 2019-11-27 06:52:19
问题 Following up this question: "Database enums - pros and cons", I'd like to know which database systems support enumeration data types, and a bit of detail on how they do it (e.g. what is stored internally, what are the limits, query syntax implications, indexing implications, ...). Discussion of use cases or the pros and cons should take place in the other questions. 回答1: I know that MySQL does support ENUM: the data type is implemented as integer value with associated strings you can have a

Why are batch inserts/updates faster? How do batch updates work?

对着背影说爱祢 提交于 2019-11-27 06:37:43
Why are batch inserts faster? Is it because the connection and setup overhead for inserting a single row is the same for a set of rows? What other factors make batch inserts faster? How do batch updates work? Assuming the table has no uniqueness constraints, insert statements don't really have any effect on other insert statements in the batch. However, during batch updates, an update can alter the state of the table and hence can affect the outcome of other update queries in the batch. I know that batch insert queries have a syntax where you have all the insert values in one big query. How do

I don't understand Collation? (Mysql, RDBMS, Character sets)

大城市里の小女人 提交于 2019-11-27 05:20:34
问题 I Understand Character sets but I don't understand Collation. I know you get a default collation with every Character set in Mysql or any RDBMS but I still don't get it! Can someone please explain in layman terms? Thank you in advance ;-) 回答1: The main point of a database collation is determining how data is sorted and compared. Case sensitivity of string comparisons SELECT "New York" = "NEW YORK";` will return true for a case insensitive collation; false for a case sensitive one. Which

Why is it recommended to avoid unidirectional one-to-many association on a foreign key? [duplicate]

折月煮酒 提交于 2019-11-27 04:15:41
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Hibernate unidirectional one to many association - why is a join table better? In the Hibernate online documentation, under section 7.2.3 One-to-many, it's mentioned, that: unidirectional one-to-many association on a foreign key is an unusual case, and is not recommended. You should instead use a join table for this kind of association. I would like to know why? The only thing that comes to my mind is, it can

What are database constraints? [closed]

一曲冷凌霜 提交于 2019-11-27 04:01:43
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . What is a clear definition of database constraint? Why are constraints important for a database? What are the types of constraints? 回答1: Constraints are part of a database schema definition. A constraint is usually associated with a table and is created with a CREATE CONSTRAINT or

Is there an official name for the many-to-many relationship table in a database schema?

▼魔方 西西 提交于 2019-11-27 02:11:33
问题 Most of the projects I've worked on have required many-to-many relationships in the database schema. For example, you might have the concept of Users and Groups, and the database might contain a table User, a table Group, and a table UserGroup to relate the two. I'm interested in the conceptual name of the UserGroup table in that example. I've grown accustomed to calling them "swing tables" because that's how I learned it, but I haven't heard other people use that term in a while. Instead, I