Re: optimizing Postgres queries

Поиск
Список
Период
Сортировка
От David Teran
Тема Re: optimizing Postgres queries
Дата
Msg-id 64C8DBBA-3F77-11D8-A528-000A95A6F0DC@cluster9.com
обсуждение исходный текст
Ответ на Re: optimizing Postgres queries  (Shridhar Daithankar <shridhar_daithankar@myrealbox.com>)
Ответы Re: optimizing Postgres queries  (Shridhar Daithankar <shridhar_daithankar@myrealbox.com>)
Re: optimizing Postgres queries  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Список pgsql-performance
Hi Shridhar,

> Are you sure you are using correct data types on indexes?
>
Did not know about this...

> e.g. if field1 is an int2 field, then following query would not use an
> index.
>
our fk have the type bigint, when i try one simple select like this:

explain analyze SELECT --columns-- FROM KEY_VALUE_META_DATA t0 WHERE
t0.ID_FOREIGN_TABLE = 21110;

i see that no index is being used whereas when i use

explain analyze SELECT --columns-- FROM KEY_VALUE_META_DATA t0 WHERE
t0.ID_FOREIGN_TABLE = 21110::bigint;

an index is used. Very fine, the performance is about 10 to 100 times
faster for the single select.

I am using WebObjects with JDBC. I will now create a DB with integer
instead of bigint and see how this performs.

regards David


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

Предыдущее
От: Shridhar Daithankar
Дата:
Сообщение: Re: optimizing Postgres queries
Следующее
От: Shridhar Daithankar
Дата:
Сообщение: Re: optimizing Postgres queries