database

Best practice for archiving a huge table of over 1,000,000,000 rows

I'm using SQL Server 2005. There is an audit trail table, containing over 1,000,000,000 rows. I'm planning to archive this table. When I make a simple select with nolock, I can still find blocking (probably IO blocking with other process?). So are there any best practice for this kind of situation? ...

SQlite query question, importing multiple records

Ok, so I am making progress since my last question. My question now is a lot more simple, or at least I understand more clearly what my question is. In my AppDelegate I have this code to read in data from my database: -(void) readFromDatabase { // Setup the database object sqlite3 *database; // Init the Array sections = [[NSMutableArra...

Is this how I design REST, and is REST what I want to be using?

In short, I am writing an Android application that I want to have pull data from a remote database. I was looking into .NET web services, but this http://stackoverflow.com/questions/297586/how-to-call-web-service-with-android question pointed me away from that direction. Is REST as simple as writing some short PHP to handle something li...

Solr returns 'oldest' records instead of 'newest'; 'Rows' and 'Start' parameters

How come Solr returns the "Oldest" records first when specifying these parameters. As you probably know these are mainly for "paging" purposes. And if I chose something like 10 Rows per page, and with the start set to 0, this means in my mind that the latest 10 records should be displayed. However, Solr displays the oldest 10 records. ...

MySql 'Select' help

I have some tables. These tables all have one column in common called 'classified_id': main_table: cars_table: id (PK) => 4222 id (PK) => 1021 classified_id => 25 classified_id => 25 Now, I want whenever a search is performed, to compare if any of the main_table.classified_id mat...

RabbitMQ and DB transactions

Hi, Does RabbitMQ support a scenario where a received message acknowledgement is sent on the DB transaction commit? Currently we send ack after DB transaction commit. If service fails inbetween, we'll get data duplication - service will get the same message again. Is there a pattern for this problem? Thanks! ...

how B-tree indexing works in mysql

my question is , when I create an index for a table in mysql, I see that the index_type is type BTREE . Now although I understand about btree(s), I do not quiet understand how it stores the index and how the database searches the records based on this. I mean, btree is excellent for databases to perform read and writes large blocks of d...

fetching blob data from sybase

Hello all my question is about sybase's ct_get_data() function i got below message when fetching TEXT data that is is not the last column of the result set. Open Client Message: Message number: LAYER = (1) ORIGIN = (1) SEVERITY = (1) NUMBER = (61) Message String: ct_get_data(): user api layer: external error: Item of 1 is not greater th...

Which Oracle table uses a sequence?

Having a sequence, I need to find out which table.column gets its values. As far as I know, Oracle doesn't keep track of this relationship. So, looking up for the sequence in source code would be the only way. Is that right? Anyone knows of some way to find out this sequence-table relationship? ...

Using LINQ with databases other than SQL Server Express 2005

I'm just starting to look into using LINQ for my database (and XML, and data object!) needs, but need to decide on which database to go with. I've been reading Pro LINQ, and it says that currently, LINQ in .NET 3.5 only supports SQL Server. I have done some googling, and have found references to using LINQ with MySQL and PostgreSQL (my...

MS Access Import from Text File problems

I'm trying to import a text file into an access database. It's not one I've written myself but the spec for the delimited text file is set up properly and the file imports properly using the wizard. When I try to use the import functions of the app itself, the ImportError table tells "Field Truncation" for one of the fields. Any help wou...

Updating previous status as dead when new update is inserted.

I have a simple insert query on my social network that allows the user to enter text in a text area and have it output on their profile page. They have the option to delete and it marks the status as dead,as intended, and erases the update. The problem is, if they just type in a new one, without deleting what is already there (which I wa...

Is it better to create the db/tables programmatically or through a .db file in assets

Hi, does Android have a "best practices" guideline on creating & populating the db/tables programmatically vs. deploying a .db file in assets? What are the pros/cons of both approaches? I have a db with big long strings in several columns, and about 50 rows, so writing the insert statements alone would take quite some space. It see...

C# Getting the size of the data returned from and SQL query

How can I get the size in bytes of the data returned from the database when executing a query? The reason for this is to compare load on the database server using two different techniques. We were running reports built from the same dataset which would load the entire dataset for every report. Now we are caching the dataset and runnin...

Database with great read performance

I have 10 tables from which 4 contain each up to million rows. All values are inserted at once, and afterwards I only read the data many times. I am searching for a database that would perform greatly when it comes to selecting, joining or other reading etc. What is the most recommended option? ...

Automatically Creating Client Schema with Microsoft Sync Framework

I need to make a local copy of a database in a .NET app so that it can function offline. My server database is SQL Server 2005, and it's copying to SQL Server 2008 Express. It doesn't have to be anything fancy - just start from scratch (or delete the existing db), copy all tables/constraints/foreign keys, and copy data from some of the...

id columns or clustered primary keys/database consistency

If I had a table with the columns: Artist Album Song NumberOfListens ...is it better to put a clustered primary key on Artist, Album, and Song or to have an autoincrementing id column and put a unique constraint on Artist, Album, and Song. How important is database consistency? If half of my tables have clustered primary keys and t...

How to re-sync the Mysql DB if Master and slave have different database incase of Mysql replication?

Mysql Server1 is running as MASTER. Mysql Server2 is running as SLAVE. Now DB replication is happening from MASTER to SLAVE. Server2 is removed from network and re-connet it back after 1 day. After this there is mismatch in database in master and slave. How to re-sync the DB again as after restoring DB taken from Master to Slave also ...

Should I remove banned contents on my database?

Hi, I'm in front of decision on how to do with flagged data by the users. The banned data could be an image, a wiki, an user and something else need to be managed like a message board. I'd like to work with user stats in many cases, to find users with bad behaviour, users with many activity, users with best photos and so on with all I c...

Should left outer joins be avoided in DB2

We are having a debate in our company. I use left outer joins quit frequently. I was told by another programmer that there is too much over head and I should not use them. Example, Lets say I have two tables, they would rather me hit the database twice get the information I need from each table store it in memory and join the data on ...