strange SELECT times

Поиск
Список
Период
Сортировка
От Zachariah Baum
Тема strange SELECT times
Дата
Msg-id 199808052125.OAA17974@JC.StudioArchetype.COM
обсуждение исходный текст
Список pgsql-admin
I have 2 sets of very similar tables, and am running very similar queries on
  both.  A join query on table set A takes a few seconds.  A very similar join
  query on table set B takes maybe 10 times as long.

Table set A is 4 tables with joins between all, and indexes on the join fields.
Here's an EXPLAIN of the query:

Sort  (cost=10.25 size=0 width=0)
  ->  Nested Loop  (cost=10.25 size=1 width=276)
        ->  Nested Loop  (cost=8.20 size=1 width=220)
              ->  Nested Loop  (cost=6.15 size=1 width=204)
                    ->  Nested Loop  (cost=4.10 size=1 width=168)
                          ->  Index Scan on posting_detail  (cost=2.05 size=1 width=88)
                          ->  Index Scan on posting  (cost=2.05 size=1 width=80)
                    ->  Index Scan on content_posting_addon  (cost=2.05 size=1198 width=36)
              ->  Index Scan on client_category  (cost=2.05 size=1 width=16)
        ->  Index Scan on content_posting_detail_addon  (cost=2.05 size=560 width=56)


Table set B has the same data, but in 2 tables, and indexes on all the join
  fields.
Here's an EXPLAIN of the query:

Sort  (cost=4.10 size=0 width=0)
  ->  Nested Loop  (cost=4.10 size=1 width=184)
        ->  Index Scan on cms_posting  (cost=2.05 size=1 width=64)
        ->  Index Scan on cms_posting_detail  (cost=2.05 size=1 width=120)

I've vacuumed the database.
There are actually less records to search through in table set B.
Both table sets reside in the same database.
Is there something I'm not doing?  It seems like the query on table set B
  should be faster, or at least the same speed, not 10 times slower!!!


--

Your Stereotype is My Reality
--Zachariah - Studio Archetype - 415-659-4435



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

Предыдущее
От: Gerald Brandt
Дата:
Сообщение: Re: [ADMIN] Limits on Tables?
Следующее
От: Navindra Umanee
Дата:
Сообщение: compiled on NetBSD but...