0
votes
0answers
31 views

Efficient way to fetch/update X records in a loop

What I need is a simple process that handles requests. I have setup a simple table as follows: CREATE TABLE Requests ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, request_param VARCHAR(250) ...
0
votes
4answers
92 views

T-SQL: Complete Database in one table

at a relational data model every logical relation is a single table with values and so on. I know someone who is this too much work and he wants to create only one table which contains all. This could ...
0
votes
1answer
58 views

Which database (Graph, Riak, etc.) would most aptly solve the following problem?

I am working on a project and was wondering if a Graph database would best solve the following problem: (This is a simplified question) Say that you have a list of friends and you want to see when ...
1
vote
1answer
103 views

Precautions when designing database schema if tables are going to have billons of rows

I am about to start work on telephone dictionary kind of project. Its confirm that there are going to be billions of records in dictionary table, and each entry from this dictionary table may have ...
0
votes
0answers
40 views

how to design my database for faster reads for my situation

I have a situation where i have two categories. Lets say type A and type B. In my database I have some 50,000 type A entries and 100,000 type B entries as of now. For each entry mentioned above(type ...
0
votes
1answer
112 views

Entity with >150 attributes: One table or many tables with relationships

I have entity with 170 attributes. It's data from vehicle monitoring. Every entity has datatime label and unique id of gps terminal. Datetime and id of terminal - these are conditions for GROUP BY ...
1
vote
1answer
1k views

Postgresql vs MySQL - Which is better for join queries & writing data(inserts) [closed]

I have to design a database which will end up with 50M records in a single table(there will be other tables with lesser number of records). I'm more concerned with join queries & writing ...
1
vote
2answers
123 views

Splitting up tables with similar structures since they contain unrelated data? (huge numbers)

Is my reasoning correct in splitting up tables with similar structures since they contain unrelated data? I'll explain the situation with an example : Suppose there is a server which hosts an online ...
5
votes
2answers
379 views

How to design index for faster deletes

I want to speed up following piece of code delete from ssn_sdo where (art_id=@art_id and skl_id=@skl_id and @level=0 ) or (art_id=@art_id and skl_id=@skl_id and @level=1 and ...
1
vote
2answers
355 views

boolean purpose column char(0) or tinyint(1)

For Boolean purpose column which one is better: nullable char(0) or tinyint(1). I know bool is an alias for tinyint(1) , but in "High Performance MySQL" book that published by O'reilly said: "If ...
0
votes
0answers
85 views

Which database and which database model for commenting system?

I am working on some commenting system and I have some doubts. Firstly, my question is which model would perform faster for "find conversation and show it and its comments with specific attributes"? ...
0
votes
1answer
89 views

Am I wrong in table design or wrong in selected index when made the table?

I've build web application as a tool to eliminate unnecessary data in peoples table, this application mainly to filter all data of peoples who valid to get an election rights. At first, it wasn't a ...
0
votes
1answer
77 views

When is it worth it to use Triggers and stored procedures/functions? [closed]

As an example, lets say I have a forum application and for every topic that is created, I have a trigger that fires a database function creating a post.(lets assume we have a topics table and a post ...
4
votes
1answer
227 views

Where and how to store my weird datamart

I could really use some help here. Here's my situation. I'm building a datamart in SQL Server 2005, which will furnish a single report (for now). We have 26 clients (medical organizations) that ...
1
vote
2answers
243 views

How should I store multiple relationships (many posts to many categories)?

I have posts stored in a posts table and I want each post to have multiple categories, what is the most efficient way to store the categories and their relationships ? I thought of it this way first: ...
4
votes
2answers
867 views

Why use separate databases for high traffic/volume tables?

While looking at the database structure of an application I am using I recognized that it uses 3 different databases on the same SQL Server instance for different things. The first one contains the ...
2
votes
2answers
253 views

How to implement posts with “seen by” like facebook?

Inside a Facebook group there is a feature when every time see the group newsfeed it mark all posts as seen by me. And if I see a specific post inside a group thought a url ...
4
votes
1answer
500 views

How to determine if there are [idle connections with] uncommitted transactions in PostgreSQL?

According to a comment on this question I asked about idle connections in PostgreSQL 9.2, some uncommitted transactions (possibly related to some of those idle connections) might cause some ...
5
votes
1answer
1k views

Could too many idle connections affect PostgreSQL 9.2 performance?

Some queries on my database server seem to take a long time to respond, and I believe the CPU usage is high. When running ps aux, I see ~250 "idle" connections (which I believe to be too many). I ...
3
votes
1answer
49 views

Does avg_query for PgBouncer include update and inserts?

Trying to tune our application and would like to know if the stats data that pgBouncer shows as avg_query, according to the PgBouncer docs on usage: avg_query Average query duration in ...
6
votes
1answer
128 views

What is a good way to determine the performance I should expect from a PostgreSQL server?

Trying to figure out how I should expect my database to perform. Basically, I need to determine when the server I have set up is reaching its performance limits - which would help me plan server ...
7
votes
3answers
669 views

SQL Database Structure for RESTful API

I am creating a RESTful API. I am struggling to decide on the best way to design my database tables around my resources. Initially, I though a table per resource would be a good way to go, but I'm ...
2
votes
1answer
346 views

How should I model a binary-tree like data using Adjacency List?

I'm making a system where a user can recruit others, resulting in a binary tree model of users. I have decided to use Adjacency List to model the data but I have some doubts about the number of fields ...
4
votes
3answers
489 views

Is a surrogate key better than a natural key in this case

I copied this code from here: CREATE TABLE records( email TEXT REFERENCES users(email), lat DECIMAL, lon DECIMAL, depth TEXT, upload_date TIMESTAMP, comment TEXT, PRIMARY ...
3
votes
1answer
188 views

What is the right way to manage users data?

I'm trying to create a simple register login script with user profiles, I created a table with the following structure: +------------+---------------+------+-----+---------+----------------+ | Field ...
2
votes
1answer
155 views

Deriving formulas for input/output

I'm currently enrolled in a DBS class and am having problem with an assignment. I've searched around and have been unable to understand what it is I'm meant to be doing with this derivation formula. ...
3
votes
2answers
153 views

Tablestructure for fast inserts/deletes with foreign keys

Current Situation We have a table called c with ca. 300,000 rows. In this table we store the competitors for a specific product. Example: id | competitors | some infos about competitor | ...
4
votes
1answer
166 views

250 billion rows - computing interconnectedness on a really huge scale

I have a table of approximately 700k rows, each identified by a unique itemnumber. Each row/item can be associated with any of the other rows/items in the table by calculating a single numerical ...
3
votes
1answer
107 views

which design better when use foreign key instead of a string to store a list of id [duplicate]

Possible Duplicate: Is using multiple foreign keys seperated by commas wrong, and if so, why? I'm building online examination system. I have designed to table, Question and GeneralExam. The ...
1
vote
2answers
102 views

How to store massive quantities of machine generated data?

I am tasked with developing a system that stores massive quantities of machine generated data (syslogs) from a number of server farms and I am wondering what tools you fine folks use such instances. ...
13
votes
2answers
2k views

Is a composite index also good for queries on the first field?

Let's say I have a table with fields A and B. I make regular queries on A+B, so I created a composite index on (A,B). Would queries on only A also be fully optimized by the composite index? ...
1
vote
1answer
265 views

Database design with different user roles connected by different relationships to one organizaiton table

An user is connected to an organization by some role. Lets say there are 2 roles freelancer and employee. One employee can only be a part of one organization and if he is an employee then he can't be ...
2
votes
2answers
503 views

Closed loops in database model, does it affect the performance?

I have heard that having loops in the database relational model should be avoided. From what I can think of, it is not a good practice, because there will be more than one different pathes to get the ...
3
votes
2answers
869 views

Index max row size error

Is there a upper bound for an array column? I am getting this error when inserting into the array field - PG::Error: ERROR: index row size 3480 exceeds maximum 2712 for index "ix_data" Here's my ...
2
votes
1answer
92 views

Help with database design

I'm quite the beginner when it comes to databases, so please bear that in mind. I need to store user statistics in several categories for an application. In the near future I will most likely need ...
5
votes
2answers
554 views

How can I save a severely fragmented database/table?

I've recently made a discovery that might explain my slow SQL run times. I found out that the default in SSMS is to allow mdf growth of 1MB at a time. When the size of one table alone is roughly 23 ...
2
votes
2answers
218 views

Writing to a DKNF database, but reading from a de-normalized table for performance?

Would the following approach be reasonable? The Goal: queries have to be relatively fast, but without the hassles incurred by writing to a de-normalized database. The Context: A database for ...
2
votes
5answers
237 views

How to shard 14 gb of data for archival database?

We have 14 GB worth of CSV's containing product information, with each CSV being all the records for a US state. We now want to store this in a database. There would be ~130 million records. The ...
5
votes
1answer
462 views

Denormalized table designs in normalized database?

There was a discussion between the developers and DBA's last week on set of tables that the developers were creating with more than 400 columns in our OLTP environment with combinations of VARCHARs, ...
170
votes
15answers
47k views

Can MySQL reasonably perform queries on billions of rows?

I am planning on storing scans from a mass spectrometer in a MySQL database and would like to know whether storing and analyzing this amount of data is remotely feasible. I know performance varies ...
6
votes
1answer
868 views

What should every DBA know? [closed]

As a SysAdmin who "wears all the hats", I find myself increasingly pulled into database projects. I took one database course back in college and since then I've always scoured resources online (like ...
2
votes
4answers
649 views

One table with many rows or many tables with a few rows

I'm having a question rounding my mind. It's better to create one table and store a lot of rows there or create various tables and have a few rows on them? What's the performance and the I/O saved at ...
0
votes
3answers
1k views

Will using bigint vs mediumint have a performance impact?

I'm considering using mediumint or bigint for an ID column. I prefer to use bigint, because that way I'm very sure that the huge numbers that the client sometimes uses are stored just fine. However, I ...
3
votes
2answers
380 views

What exactly is “pinning” in relation to indexes?

When one talks about "pinning" in indexes, what exactly is this? Is there some other word/term I can search for, as google has not provided any solutions. It is part of a test question, where ...
2
votes
1answer
442 views

Need advice for a 'tag' table design

My website has different content types. All content types should be tag-able (except if specified in the model, whatever). I can think of 2 options for my design: 2 tables option : 1 table for the ...
2
votes
1answer
118 views

Group_by and having vs Joins when table is self joined 5-6 times

Now the situation due to which this question came to me. Schema is Table User_Read_Book user_id | book_id Now I want to get users who have read certain books. Say give me users who ...
3
votes
1answer
821 views

PostgreSQL versus MySQL for EAV structures storage

Is there any practical difference or what are the advantages of using Postgres 9.x versus MySQL 5.x for storing EAV (Entity-Attribute-Value) structures, especially in terms of read performance?
2
votes
1answer
68 views

Single field instead of several fields

There is a relational database with the following Users table User Id Name Age Parents Friends Colleagues ... And there are tables Parents, Friends, Colleauges, etc. Due to specifics of database ...
2
votes
1answer
212 views

Oracle ash report

Recently, i have been handed over with an ash report from DBA. To me this report is like french. I have no idea what it is about and what all is written in this report. Can someone please guide me in ...
2
votes
3answers
322 views

Express union which is dependent on other results

I would like to make a union of two tables that are actually in a hierarchical constellation. How would I write that in relational algebra? Say table A is the parent of B in a 1:n relationship. ...