Re: Problems with non use of indexes

Поиск
Список
Период
Сортировка
От Tyler Durden
Тема Re: Problems with non use of indexes
Дата
Msg-id CAL0cWDTDSh5x0Dzfoya3uBhASAH-M7ODeaNuw3S2RU7ScuGiGA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Problems with non use of indexes  ("Tomas Vondra" <tv@fuzzy.cz>)
Список pgsql-general
http://explain.depesz.com/s/f92O

EXPLAIN ANALYSE VERBOSE SELECT "activity_action"."id", "activity_action"."actor_id", "activity_action"."verb", "activity_action"."action_content_type_id", "activity_action"."action_object_id", "activity_action"."target_content_type_id", "activity_action"."target_object_id", "activity_action"."public", "activity_action"."created", "auth_user"."id", "auth_user"."username", "auth_user"."first_name", "auth_user"."last_name", "auth_user"."email", "auth_user"."password", "auth_user"."is_staff", "auth_user"."is_active", "auth_user"."is_superuser", "auth_user"."last_login", "auth_user"."date_joined" FROM "activity_action" INNER JOIN "auth_user" ON ("activity_action"."actor_id" = "auth_user"."id") WHERE "activity_action"."actor_id" IN (SELECT U0."object_id" FROM "activity_follow" U0 WHERE (U0."content_type_id" = 3 AND U0."user_id" = 1)) ORDER BY "activity_action"."created" DESC LIMIT 100;

---

http://explain.depesz.com/s/o3w

EXPLAIN ANALYSE VERBOSE SELECT "activity_action"."id", "activity_action"."actor_id", "activity_action"."verb", "activity_action"."action_content_type_id", "activity_action"."action_object_id", "activity_action"."target_content_type_id", "activity_action"."target_object_id", "activity_action"."public", "activity_action"."created", "auth_user"."id", "auth_user"."username", "auth_user"."first_name", "auth_user"."last_name", "auth_user"."email", "auth_user"."password", "auth_user"."is_staff", "auth_user"."is_active", "auth_user"."is_superuser", "auth_user"."last_login", "auth_user"."date_joined" FROM "activity_action" INNER JOIN "auth_user" ON ("activity_action"."actor_id" = "auth_user"."id") WHERE "activity_action"."actor_id" IN (SELECT U0."object_id" FROM "activity_follow" U0 WHERE (U0."content_type_id" = 3)) ORDER BY "activity_action"."created" DESC LIMIT 100;

---

http://explain.depesz.com/s/ccJ

EXPLAIN ANALYSE VERBOSE SELECT U0."object_id" FROM "activity_follow" U0 WHERE (U0."content_type_id" = 3 AND U0."user_id" = 1);


On Fri, Mar 2, 2012 at 2:23 PM, Tomas Vondra <tv@fuzzy.cz> wrote:
On 2 Březen 2012, 14:34, Tyler Durden wrote:
> On Fri, Mar 2, 2012 at 12:55 PM, Tomas Vondra <tv@fuzzy.cz> wrote:
>
>> On 2 Březen 2012, 13:45, Tyler Durden wrote:
>> >>
>> > Yes, but if I remove *U0."user_id" = 1 *will use the index:
>>
>> Which PostgreSQL version is that? Post EXPLAIN ANALYZE output for all
>> three queries, not just EXPLAIN. And use explain.depesz.com if possible,
>> it's much more readable.
>>
>> kind regards
>> Tomas
>>
>
> I'm using PostgreSQL 8.4.2 and you can find the EXPLAIN ANALYSE VERBOSE in
> http://explain.depesz.com/s/hk2

For all three queries, please.

Tomas


В списке pgsql-general по дате отправления:

Предыдущее
От: "Tomas Vondra"
Дата:
Сообщение: Re: Problems with non use of indexes
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: archive_cleanup_command recovery.conf Standby server error