What type of index do I need for this JOIN? - Mailing list pgsql-general

From Robert James
Subject What type of index do I need for this JOIN?
Date
Msg-id CAGYyBgjO1ci8Di7G7nqpR0Jwa+Oywwb4Hs-1QeDBaCgknrHpdA@mail.gmail.com
Whole thread Raw
Responses Re: What type of index do I need for this JOIN?  (Craig Ringer <craig@2ndquadrant.com>)
List pgsql-general
I'm doing a JOIN which is very slow:

JOIN t ON t.f1 LIKE (q.f1 || '%')

t1 has an INDEX on (f1, f2) which I thought would help for this.  But
Postgres seems to still use a (very slow) Nested Loop.  What type of
index would be appropriate for this?

(My goal is to join on a substring starting from the first character)


pgsql-general by date:

Previous
From: Robert James
Date:
Subject: Materializing a view by hand
Next
From: Sergey Konoplev
Date:
Subject: Re: Performance of ORDER BY RANDOM to select random rows?