Re: strange query results

Поиск
Список
Период
Сортировка
От Anand Raman
Тема Re: strange query results
Дата
Msg-id 20010213105419.A20704@india-today.com
обсуждение исходный текст
Ответ на Re: strange query results  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: strange query results  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi tom
The table description is as follows

arttoday=> \d exhibit_distributions
                                    Table "exhibit_distributions"
          Attribute           |     Type      |                       Modifier
------------------------------+---------------+------------------------------------------------------
 exhibit_distribution_id      | integer       | not null default nextval('sq_exhibit_dist_id'::text)
 exhibit_id                   | integer       | not null
 created_by                   | integer       | not null
 creation_date                | timestamp     | not null default "timestamp"('now'::text)
 last_update_date             | timestamp     |
 last_updated_by              | integer       |
 exhibit_type_id              | integer       | not null
 medium                       | varchar(100)  |
 image_path_small             | varchar(50)   |
 image_path_big               | varchar(50)   |
 length                       | numeric(7,2)  |
 breadth                      | numeric(7,2)  |
 width                        | numeric(7,2)  |
 diameter                     | numeric(7,2)  | default 8
 dimensional_aspect           | varchar(50)   | default 'Dimensions'
 unframed_volume_weight       | numeric(10,2) |
 framed_volume_weight         | numeric(10,2) |
 override_vw_computation      | boolean       | default 'f'::bool
 exhibit_code                 | varchar(25)   |
 exhibit_options              | varchar(10)   |
 unframed_exhibit_restriction | varchar(25)   | default 'WORLD'
 framed_exhibit_restriction   | varchar(25)   | default 'WORLD'
 up_for_sale                  | char(1)       | not null default 'T'
 gallery_id                   | integer       |
 site_section                 | varchar(20)   | not null default 'GALLERY'
Index: exhibit_distributions_pkey
Constraints: ((up_for_sale = 'T'::bpchar) OR (up_for_sale = 'F'::bpchar))
             (length > '0'::"numeric")
             (breadth > '0'::"numeric")
             (width > '0'::"numeric")
             (((unframed_exhibit_restriction = 'WORLD'::"varchar") OR (unframed_exhibit_restriction =
'INDIA'::"varchar"))OR (unframed_exhibit_restriction = 'ONLY_WORLD'::"varchar")) 
             (((framed_exhibit_restriction = 'WORLD'::"varchar") OR (framed_exhibit_restriction = 'INDIA'::"varchar"))
OR(framed_exhibit_restriction = 'ONLY_WORLD'::"varchar")) 
             (((exhibit_options = 'FRAMED'::"varchar") OR (exhibit_options = 'UNFRAMED'::"varchar")) OR
(exhibit_options= NULL::"varchar")) 

Explain plan results in the following
arttoday=> explain select site_section, count(*) from exhibit_distributions group by site_section;
NOTICE:  QUERY PLAN:

Aggregate  (cost=69.83..74.83 rows=100 width=12)
  ->  Group  (cost=69.83..72.33 rows=1000 width=12)
          ->  Sort  (cost=69.83..69.83 rows=1000 width=12)
                        ->  Seq Scan on exhibit_distributions
                        (cost=0.00..20.00 rows=1000 width=12)

The problem still persists.. I will a drop and recreation of the db just
in case..

Thanks for the help
Anand
On Mon, Feb 12, 2001 at 11:04:55AM -0500, Tom Lane wrote:
>Anand Raman <araman@india-today.com> writes:
>> The second query is not priniting out site_section column.
>
>Odd.  What is the exact definition of table exhibit_distributions?
>Does it have any indices?  What plan is printed by EXPLAIN for the
>problem query?
>
>            regards, tom lane

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

Предыдущее
От: Vince Vielhaber
Дата:
Сообщение: Re: Re: 7.1 Docs WAS:Auto-timestamp generator (attached)
Следующее
От: Anand Raman
Дата:
Сообщение: Re: jdbc connection pool settings