Re: count(*), EXISTS, indexes
От | Itai Zukerman |
---|---|
Тема | Re: count(*), EXISTS, indexes |
Дата | |
Msg-id | 87he94r8ua.fsf@matt.w80.math-hat.com обсуждение исходный текст |
Ответ на | Re: count(*), EXISTS, indexes (Josh Berkus <josh@agliodbs.com>) |
Ответы |
Re: count(*), EXISTS, indexes
|
Список | pgsql-sql |
>> # explain select sum(weight) from rprofile rp where exists (select 1 from > rcount_prof rcp where rcp.profile ~<= rp.profile and ~rcp.psig ~<= rp.psig > and rcp.filter='{734,1944}'); > > I'm not familiar with the "~" that you have in the query. What are those for? They are my own operators and functions. profile is a integer array and the ~'s are subset operators. psig is a bit signature, "~" is complement, and the ~ operators again are subset operators. > Do you have an index on rcp.profile, rcp.psig, rcp.filter? Yes, yes, and yes. ATM, though, there are only about 50 rows in rcount_prof. The vast majority of time is spent scanning the 600,000-row rprofile table. -- Itai Zukerman <http://www.math-hat.com/~zukerman/>
В списке pgsql-sql по дате отправления: