Question: I have a datatable that contains 2.5M rows. I would like to filter some rows in the datatable.

**Columns of the datatable :**

```
[IntCode] long
[BDIntCode] long
[TxnDT] DateTime
[TxnQuantity] decimal
[RecordUser] long
[RecordDT] DateTime

```

**My code is like below :** 

```
            foreach (var down in breakDowns)
            {
                sw.Start();
                var relatedBreakDowns = firstGroup.Where(x => x.RelatedBDIntCode == down.ProcessingRowIntCode).ToList();
                if (relatedBreakDowns.Count == 0) continue;

                var filters = string.Format("BDIntCode IN ({0})", string.Join(",", relatedBreakDowns.Select(x => x.BDIntCode)));
                var filteredDatatable = datatable.Select(filters, "BDIntCode");
                foreach (var dataRow in filteredDatatable)
                {
                    var r = dataTableSchema.NewRow();
                    r["RecordUser"] = recordUser;
                    r["RecordDT"] = DateTime.Now;
                    r["TxnQuantity"] = dataRow["TxnQuantity"];
                    r["TxnDT"] = dataRow["TxnDT"];
                    r["BDIntCode"] = down.ProcessingRowIntCode;
                    dataTableSchema.Rows.Add(r);
                }
                sw.Stop();
                count++;
                Console.WriteLine("Group: " + unrelatedBreakDownGroup.RelatedBDGroupIntCode + ", Count : " + count + ", ElapsedTime : ms = " + sw.ElapsedMilliseconds + ", sec = " + sw.ElapsedMilliseconds / 1000f );
                sw.Reset();
            }

```

The count of the breakDowns list is 1805, the count of the firstGroup list is 9880.

Answer: 
You should add `exit;` after the header.
If you skip the `exit;` or `die;` statements your script will continue to execute after the redirection header.
The best way to check if a post request has been made is to check with and close with exit;

```
if($_SERVER['REQUEST_METHOD'] == 'POST');
{
    header("Location: http://www.google.com");
    exit;
}

```