From: | Aren Cambre <aren(at)arencambre(dot)com> |
---|---|
To: | Merlin Moncure <mmoncure(at)gmail(dot)com> |
Cc: | Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, pgsql-performance(at)postgresql(dot)org |
Subject: | Re: Postgres refusing to use >1 core |
Date: | 2011-05-10 02:40:35 |
Message-ID: | BANLkTi=BvGMvsBNq8DUt=_MPJXZjcC0TWg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
>
> how are you reading through the table? if you are using OFFSET, you
> owe me a steak dinner.
>
>
Nope. :-)
Below is my exact code for the main thread. The C# PLINQ statement is
highlighted. Let me know if I can help to explain this.
NpgsqlConnection arrestsConnection = new NpgsqlConnection
(Properties.Settings.Default.dbConnectionString);
arrestsConnection.Open();
/// First clear out the geocoding table
NpgsqlCommand geocodingTableClear = new NpgsqlCommand("TRUNCATE
raw.\"TxDPS geocoding\"", arrestsConnection);
geocodingTableClear.ExecuteNonQuery();
NpgsqlDataReader arrests = new NpgsqlCommand("SELECT * FROM
\"raw\".\"TxDPS all arrests\"", arrestsConnection).ExecuteReader();
/// Based on the pattern defined at
foreach(IDataRecord arrest in
from row in arrests.AsParallel().Cast <IDataRecord>()
select row)
{
Geocoder geocodeThis = new Geocoder(arrest);
geocodeThis.Geocode();
}
arrestsConnection.Close();
Aren
From | Date | Subject | |
---|---|---|---|
Next Message | Shaun Thomas | 2011-05-10 03:13:43 | Re: Benchmarking a large server |
Previous Message | Merlin Moncure | 2011-05-10 02:37:37 | Re: Postgres refusing to use >1 core |