Re: LONG delete with LOTS of FK's

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Larry Rosenman <ler(at)lerctr(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: LONG delete with LOTS of FK's
Date: 2013-05-02 15:08:37
Message-ID: 25119.1367507317@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Larry Rosenman 2013-05-02 15:33:09 Re: LONG delete with LOTS of FK's
Previous Message Larry Rosenman 2013-05-02 14:50:53 Re: LONG delete with LOTS of FK's