Improve query speed for extension registry
Created by: eseliger
When looking into finding out why I see some slow requests (which were just caused by latency after all), I found that this query made up 32% of the total execution time of queries, according to pghero (thanks @tsenart!). To my understanding of SQL, this should be equal with postgresql. I tested it using explain analyze and it's about 5x as fast (rudimentary average calculation over 5 manual runs, from 55ms down to 12ms)