SELECT operation with four joins results in bad performance
--I think this is mandatory for your query performance:
    --Because you do joins using this columns from parent to child 

    create index on doer_locations(doer_id);
    create index on job_realizations(job_place_id);
    create index on job_realizations(doer_id);

    --Maybe very big and slowdown other operations... 
    --create index on job_realizations(lat);
    --create index on doer_locations(lat); 
    --create index on job_realizations(lng);
    --create index on doer_locations(lng); 

    --Maybe not mandatory: 
    create index on job_realization(realizations_per_place);
    create index on job_realization(realizations_per_place_per_doer); 

SELECT DISTINCT doers.id FROM doers
    JOIN doer_locations dl ON dl.doer_id = doers.id
    JOIN job_places jp ON (jp.lat - 0.3147625620715557) &lt; dl.lat AND (jp.lat + 0.3147625620715557) &gt; dl.lat AND (jp.lng - 0.5001626620527362) &lt; dl.lng AND (jp.lng + 0.5001626620527362) &gt; dl.lng
    LEFT JOIN job_realizations jr ON jr.job_place_id = jp.id
    LEFT JOIN job_realizations jrpd ON jrpd.job_place_id = jp.id AND jrpd.doer_id = doers.id
    WHERE (jp.job_id = 1 AND doers.id IS NOT NULL)
    GROUP BY doers.id, jp.id
    HAVING COUNT(DISTINCT jr.id) &lt; jp.realizations_per_place AND COUNT(DISTINCT jrpd.id) &lt; jp.realizations_per_place_per_doer


Please try and if it solve your problem select it as the right answer.