Question: I basically have one big gigantic table (about 1.000.000.000.000 records) in a database with these fields:

id, block\_id, record

id is unique, block\_id is not unique, it contains about 10k (max) records with the same block\_id but with different records

To simplify my job that deals with the DB I have an API similar to this:

```
Engine e = new Engine(...);
// this method must be thread safe but with fine grained locked (block_id) to improve concurrency
e.add(block_id, "asdf"); // asdf up to 1 Kilobyte  max

// this must concatenate all the already added records added block_id, and won't need to be bigger than 10Mb (worst case) average will be <5Mb
String s = e.getConcatenatedRecords(block_id);

```

If I map each block to a file(haven't done it yet), then each record will be a line in the file and I will still be able to use that API

But I want to know if I will have any peformance gain by using flat files compared to a well tunned postgresql database ? (at least for this specific scenario)

My biggest requirement though is that the getConcatenatedRecords method returns stupidly fast (not so with the add operation). I am considering caching and memory mapping also, I just don't want to complicate myself before asking if there is an already made solution for this kind of scenario ?

Answer: 
The problem is your event, you event is for the other drop down, your event should be:

```
protected void ddlType_SelectedIndexChanged(object sender, EventArgs e)
{
    BindExercise();
}

```

A contribution to your code, if you populate your dropdown with datasource, the items that you add will not appear if they are before the bind (). You must add the following, to stay but the latest:

```
ddlType.Items.Insert(0, "--Please Select country--");

```

I hope I have been helpful, and good luck with your question.
(Sorry form my english)
The Problem appear in the selectedIndexChanged function , which might be fired when the index of ddltype dropdownlist changed instead of dllExericese , also you should ensure the dlltype selectedindex not change after using the autopost method by setting dlltype.SelectedIndex=dlltyp.selectedindex in the function dlltype\_selectedindexchanged associated to the dlltype dropdownlist.