From: | Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com> |
---|---|
To: | Bill House <wch-tech(at)house-grp(dot)net> |
Cc: | Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>, psycopg(at)postgresql(dot)org |
Subject: | Re: Capacity questions |
Date: | 2012-06-17 18:17:19 |
Message-ID: | 4FDE1F2F.30304@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | psycopg |
On 06/17/2012 11:11 AM, Bill House wrote:
> On 06/17/2012 01:02 PM, Daniele Varrazzo wrote:
>> On Sun, Jun 17, 2012 at 4:32 PM, Bill House <wch-tech(at)house-grp(dot)net> wrote:
>>
>>> I have a written a script which does what I want it to do on a table
>>> with 999 records.
>>>
>>> I was wondering if there is anything I need to consider if I run this
>>> script on a table with 1.1 million records?
>> It looks fine for me. The only note is that, I may be wrong, but
>> "UPDATE %s SET del = False" updates the records having del already
>> false too, taking more time and creating unnecessary bloat. Adding
>> "WHERE del" may help keeping the bloat to the minimum.
>>
>> -- Daniele
>>
>>
> You are referring to the first SQL command, and you are correct. And on
> a table this size, time is a consideration; even if it is a one-time task.
An additional comment:
You really ought to consider using the parameter passing mechanism built into psycopg2:
http://initd.org/psycopg/docs/usage.html#passing-parameters-to-sql-queries
See here for why that is important:
http://blog.endpoint.com/2012/06/detecting-postgres-sql-injection.html
>
> Thanks very much.
>
> Regards,
>
> Bill
>
--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Daniele Varrazzo | 2012-06-18 09:28:22 | Re: Capacity questions |
Previous Message | Bill House | 2012-06-17 18:11:12 | Re: Capacity questions |