database

Which is faster, horizontal or vertical counting?

I need to get summary data from many many rows. The summary fields are counts of how many entries have each value for different fields. For example, a table with people's age, city, job, etc, the summary data would include fields like "countManager", "countCodeMonkey" for each job, and then "countChicago", "countNewYork" etc for cities. ...

Images in iPhone app

Hi, I am creating a multilayered iPhone app using a navigation controller and the app includes a lot of images in every layer. I was wondering if it is a good idea to use a SQLite database to store all the images and extract them to the page when needed or should i just add all the images to the resources folder and pull them into the ap...

MongoDB: What’s the most efficient way to store a chromosome/position

I want to store some genomic positions (chromosome,position) using MongoDB. something like: { chrom:"chr2", position:100, name:"rs25" } I want to be able to quickly find all the records in a given segment (chrom , [posStart - posEnd]). What would be the best key/_id to be used ? a chrom , position object ? db.snps.save({_id:{chrom...

MongoDB as the primary database?

I have read a lot of the MongoDB. I like all the features it provides, but I wonder if it's possible to have it as the only database for my application, including storing sensitive information. I know that it compromises the durability part in ACID but I will as a solution have 1 master and 2 slaves in different locations. If I do tha...

ACID and database transactions?

What is the relationship between ACID and database transaction? Does ACID give database transaction or is it the same thing? Could someone enlighten this topic. ...

When do I need map reduce for database queries?

In CouchDB you always have to use map reduce to query results. In MongoDB you can their query methods for retrieving data, but they also let you do map-reduce. I wonder, when do I actually need map-reduce? Are those query methods different from map-reduce or are they just wrappers for map-reduce functions? ...

I have to write every function i need for CouchDB?

In MongoDB you have a lot of helper methods that do all the basic operations for you: count sort update replace etc... In CouchDB you ahve to write map-reduce for everything by hand for basic operations? ...

Avoiding duplicating SQL code?

Hi, I know many ways to avoid duplicating PHP code (in my case PHP). However, I am developing a rather big application that does some calculations on the database with the data it finds, and I have noticed the need to use the same code (parts of SQL) in other places. I don't like the idea of copying and pasting the same thing over and ...

Make WCF uploading/downloading faster

My WCF server exposes database access remotely and ensures authentication. Typically, users download and upload large documents. The remote connection turns out to be quite slow. Are there any tips and tricks for optimizing the service to handle those types of communication effectively? ...

Mysql how to set time data type to be only HH:MM in database

Hi, how can I set my mysql database field "time" data type to only be HH:MM in the database, in my script the user only enters HH:MM and the DB automatically adds the last :SS digits, the problem is when I pull that value to edit, it adds the last digits also, which is kind of annoying, I can get rid of it with PHP and truncating off the...

How to select an entire database and display all the information.

Is it possible to select all the tables from a database (not knowing their names) and displaying them? My friend has a mysql server but he doesn't have phpMyAdmin installed and he's begging me to transfer all his php-fusion accounts to his new WordPress blog. He doesn't understand a thing with mysql... Anyone got an idea? ...

Connect MS Access to remote DB2 database without installing DB2 locally

I've found instructions on how to connect MS Access as a front-end to a DB2 database, but it appears that installing DB2 locally is a prerequisite (so that you have the DB2 ODBC driver). But I don't want to install locally. I want to connect to a remote DB2 database. I can't seem to figure out how I can get that driver installed without ...

Poor MySQL Join Performance

I've been trying to perform a join on two tables in MySQL, and the query will run for a minute or two before I run out of memory without getting results. I'm far from a database expert, so I'm not sure if I'm writing my queries poorly, if I have some MySQL settings poorly configured, or if I really should be doing something else entirel...

update rows with duplicate entries

I have the same situation as this other question, but I don't want to select the rows, I want to update these rows. I used the solution Scott Saunders made: select * from table where email in ( select email from table group by email having count(*) > 1 ) That worked, but I wanted to change/update a row-value in these entries, so ...

What simple database can I use to store and query data just for myself?

I have come across various situations, where I want to store some formatted data in a way such that it can be easily queried. For example $ cat so.txt "question_id": 58640, "tags": ["polls", "fun", "quotes"], "title": "Great programming quotes" "question_id": 184618, "tags": ["polls", "fun", "comment"], "title": "What is the best comme...

Python, how to instantiate classes from a class stored in a database?

I'm using Django and want to be able to store classes in a database for things like forms and models so that I can easily make them creatable through a user interface since they are just stored in the database as opposed to a regular file. I don't really know a whole lot about this and am not sure if this is a situation where I need to u...

How to model photo stacks in sql database?

I have a fairly typical sql database for storing photos: id, url, name I'd like to have a user be able to stack photos (like in Adobe elements). What is the best way to save such stacks in the database? A separate table with a one to many relationship to the photos table would work, but it means one has work with different object types...

How should I design the tables to store tags in a database?

"question_id": 58640 "tags": ["polls", "fun", "quotes"] "title": "Great programming quotes" "question_id": 184618 "tags": ["polls", "fun", "comment"] "title": "What is the best comment in source code you have ever encountered?" "question_id": 3734102 "tags": ["c++", "linux", "exit-code"] "title": "Why cant' I return bigger values from ma...

minimize number of tables in MySQL?

Basic question about a good way of organizing data in a database. Let's say I have a search site for multiple stores. Each store has a number of products. What is the best way of organizing price and inventory data? I see two ways of doing this: a table for every store , with the first column or two identifying a product, a column for ...

Multilanguage content tables Q

So I have 1 Content table for storing all system text. (it is a user content website) content_id, Keyword, en, fr, ea, sp, ........ (each of these columns refers to a language ID from the language lookup table). This is fine upto here, but now how do I translate the data stored in other tables - in the lookup tables such as City names...