Hi,
2011/8/30 Szymon Kosok <szymon@mwg.pl>:
> 2011/8/30 Ondrej Ivanič <ondrej.ivanic@gmail.com>:
>> Could you please re-post your explain using this web site:
>> http://explain.depesz.com/ and post links to Stackoverflow question?
>
> Here it is: http://explain.depesz.com/s/Iaa
>
>> - try to disable nested loop join (set enable_nestloop=off)
Thanks, I would try to "materialise" spoleczniak_tablica table. Your
query looks like this:
select ...
from spoleczniak_tablica
inner join ...
where ...
order by spoleczniak_tablica.id desc
limit 21
So I would rewrite your query like this:
select ...
from (
select ...
from spoleczniak_tablica
where ....
order by spoleczniak_tablica.id desc
limit 21
) as x
inner join ...
--
Ondrej Ivanic
(ondrej.ivanic@gmail.com)