Re: LONG delete with LOTS of FK's

From: Larry Rosenman <ler(at)lerctr(dot)org>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: LONG delete with LOTS of FK's
Date: 2013-05-02 15:33:09
Message-ID: b656ed94eb26b999c485e1a86f1e4328@webmail.lerctr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2013-05-02 10:08, Tom Lane wrote:
> Larry Rosenman <ler(at)lerctr(dot)org> writes:
>> Question: Do all these need to have a bare index just on the
>> account_id
>> column, or is a multicolumn index with account_id first
>> sufficient for the check to be reasonably quick?
>
> I would think that such an index would be sufficient, but you could
> check for yourself by doing something like
>
> explain select 1 from <table> where account_id = <something>
>
> and verifying that you get an indexscan not a seqscan, for each
> dependent table.
>
> regards, tom lane
Thanks, Tom. I found 12 tables with Sequential scans.

We'll fix that.

Appreciate the help.

--
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 214-642-9640 (c) E-Mail: ler(at)lerctr(dot)org
US Mail: 430 Valona Loop, Round Rock, TX 78681-3893

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Josh Berkus 2013-05-02 20:03:23 Re: [GENERAL] Update links
Previous Message Tom Lane 2013-05-02 15:08:37 Re: LONG delete with LOTS of FK's