Re: slow self-join query - Mailing list pgsql-performance

From Robert Poor
Subject Re: slow self-join query
Date
Msg-id CAGHqdqVVwR5NvgpyC_eAp3fF8fQa_VA=SVaoEA3chx+eDjPq9g@mail.gmail.com
Whole thread Raw
In response to Re: slow self-join query  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: slow self-join query  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-performance
@merlin, @kevin:  Thank you both -- I'll try your suggestions as soon
as I get back to the mothership.

@kevin: I hear you.  (I'm deeply steeped in Ruby on Rails and
foolishly assume that it's easy to read.)  With that in mind:

\d user_associations
                                  Table "public.user_associations"
   Column    |            Type             |
Modifiers
-------------+-----------------------------+---------------------------------------------------------
 id          | integer                     | not null default
nextval('followings_id_seq'::regclass)
 leader_id   | integer                     |
 follower_id | integer                     |
 created_at  | timestamp without time zone | not null
 updated_at  | timestamp without time zone | not null
Indexes:
    "followings_pkey" PRIMARY KEY, btree (id)
    "index_followings_on_leader_id_and_follower_id" UNIQUE, btree
(leader_id, follower_id)
    "index_followings_on_follower_id" btree (follower_id)
    "index_followings_on_leader_id" btree (leader_id)

pgsql-performance by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: slow self-join query
Next
From: "Kevin Grittner"
Date:
Subject: Re: slow self-join query