Re: Query questions

Поиск
Список
Период
Сортировка
От A. Kretschmer
Тема Re: Query questions
Дата
Msg-id 20060731134944.GA25738@webserv.wug-glas.de
обсуждение исходный текст
Ответ на Query questions  ("Christian Rengstl" <Christian.Rengstl@klinik.uni-regensburg.de>)
Список pgsql-general
am  31.07.2006, um 15:32:19 +0200 mailte Christian Rengstl folgendes:
> Hi list,
>
> i have a problem with creating a query and i hope somebody can give me
> some hints. I have the following table
> pid(varchar), crit(varchar), val1(varchar), val2(varchar),
> iDate(timestamp)
> where there are up to 63 million lines with 1500 distinct pids and
> around 42000 distinct crits:
> pid   crit   val1   val2   iDate
> 'yyy'  'aaa'  'b'    'c'      someTime
> 'yyy'  'bbb'  'b'    'a'      anotherTime
> ...
> What i have to do is to export the table for which i have to query the
> table with the following pattern: select val1, val2 from mytable where
> pid='yyy' and crit='aaa'. But if i do this 63 million times, it just
> takes too long. So, what i would like to do is to make a query where i

Do you have indexe on pid and crit?
Can you paste a "explain analyse select val1, val2 from mytable where
pid='yyy' and crit='aaa';"

Which version? ("select version();").


HTH, Andreas
--
Andreas Kretschmer    (Kontakt: siehe Header)
Heynitz:  035242/47215,      D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
 ===    Schollglas Unternehmensgruppe    ===

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

Предыдущее
От: "Christian Rengstl"
Дата:
Сообщение: Query questions
Следующее
От: "Christian Rengstl"
Дата:
Сообщение: Antw: Re: Query questions