rdbms

Postgresql.conf variables

Hi again, I have been playing around with the postgresql.conf file for a couple days now. I was wondering what variables you guys like customizing and why? Here is a sample of the file: # - TCP Keepalives - # see "man 7 tcp" for details #tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; # 0 selects the system default #tc...

PosgreSQL Query Optimization and the Postmaster Process'

Hi again, I currently working with a larger wikipedia-dump derived PostgreSQL database; it contains about 40 GB of data. The database is running on an HP Proliant ML370 G5 server with Suse Linux Enterprise Server 10; I am querying it from my laptop over a private network managed by a simple D-Link router. I assigned static DHCP (private...

Someone tell me why my database design is stupid, and how I can fix it

So I have these vehicles, many different types of them. Every type has its own table, with many attributes. Then I have a "vehicles" table, which holds the ids and types of all the vehicles in every table. Vehicles can have photos, so I have a "photos" table, with a vehicle_id, linking the photo to the vehicle it belongs to. Now every v...

Long UPDATE in postgresql

Hi there, I have been running an UPDATE on a table containing 250 million rows with 3 index'; this UPDATE uses another table containing 30 million rows. It has been running for about 36 hours now. I am wondering if their is a way to find out how close it is to being done for if it plans to take a million days to do its thing, I will kil...

Consistent handling of DateTimes in different RDBMS's

Hello! I'm planning a distributed system of applications that will communicate with different types of RDBMS. One of the requirements is consistent handling of DateTimes across all RDBMS types. All DateTime values must be at millisecond precision, include the TimeZone info and be stored in a single column. Since different RDBMS's handl...

Vertical to Horizontal?

Hi again, I have a PostgreSQL table that looks like this: A -> B A -> C A -> G A -> H B -> O B -> K Where "->" separates two columns where the first points to the second (hyperlinks). Now I would like to take all distinct values in the first column and assign them an ARRAY containing all values to which they point to in the second co...

PostgreSQL Long VACUUM

Hi again, I am currently cleaning up a table with 2 indexes and 250 million active rows and approximately as many dead rows (or more). I issued the command VACCUM FULL ANALYSE from my client computer (laptop) to my server. It has been going about its business for the last 3-4 days or so; I am wondering if it will end anytime soon for I ...

How to display source of DB2 SQL UDF

Is there any way to see SQL UDF body in DB2 control center? ...

How do cursors work in Python's DB-API?

Hi again, I have been using python with RDBMS' (MySQL and PostgreSQL), and I have noticed that I really do not understand how to use a cursor. Usually, one have his script connect to the DB via a client DB-API (like psycopg2 or MySQLdb): connection = psycopg2.connect(host='otherhost', etc) And then one creates a cursor: cursor = co...

How to design a movie database?

Hi Guys, I'm trying to get my head round this mind boggling stuff they call Database Design without much success, so I'll try to illustrate my problem with an example. I am using MySQL and here is my question: Say I want to create a database to hold my DVD collection. I have the following information that I want to include: Film Tit...

Datastructures used in DBMS

What are the datastructure used in DBMS like Oracle,MySQL & Sqlite for storing and retrieving records. ...

Database Schema for Machine Tags?

Machine tags are more precise tags: http://www.flickr.com/groups/api/discuss/72157594497877875. They allow a user to basically tag anything as an object in the format object:property=value Any tips on a rdbms schema that implements this? Just wondering if anyone has already dabbled with this. I imagine the schema is quite similar to imp...

Drop all tables command

What is the command to drop all tables in SQLite? Similarly I'd like to drop all indexes. ...

In a database table, what is the maximum number of primary keys?

In a database table, what is the maximum number of primary keys? ...

Resources about building an RDBMS

I'm looking at implementing an RDBMS. Are there any good resources out there about how a database works internally, and the kinds of things I'd need to know when starting out to build my own? (Please no comments about whether it's a practical idea or not - just imagine it's for a hobby project or something). Again - interested in the ...

Storing conditional logic expressions/rules in a database.

How can I store logical expressions using a RDBMS? I tag objects and would like to be able to build truth statements based on those tags. (These might be considered as virtual tags.) Tags new for_sale used offer Rule second_hand_goods = (!new or used) and for_sale new_offer = new and offer second_hand_offer = second_hand_goods and of...

Ranking in MySQL, how do I get the best performance with frequent updates and a large data set?

I want grouped ranking on a very large table, I've found a couple of solutions for this problem e.g. in this post and other places on the web. I am, however, unable to figure out the worst case complexity of these solutions. The specific problem consists of a table where each row has a number of points and a name associated. I want to be...

How to: MySQL How to retrieve record based on three properties?

I am new to SQL and relational DBMS. I want to retrieve records from a relational database if they satisfy 3 given properties. For example, if there is a table containing info about solids: table_solid : |s_id|s_name|description| table_width : |w_id|w_name| table_height: |h_id|h_name| table_length: |l_id|l_name| where *_id are all pr...

What is the complexity of finding median and doing counts in MySQL?

I would like to know what the complexity of the following two operations are. The first case is a count where I order by a column that I have an index on and ask for the count of all values below or above a certain number like this: SELECT count(*) FROM tbl WHERE col1 > 10 ORDER BY col1; The other case is concerning a median operation...

Basic RDBMS design and schema creation in Oracle

Hi, I have to create a entire application in an Oracle RDBMS with SQL. The Design includes to complete full entity-relationship and also design the relevant Schema with object creations.Important is-When creating schema and objects..we should fully apply normalisation. Also, writing all the relevant SQLs in each and every step in this p...