Re: PostgreSQL Indexing versus MySQL

Поиск
Список
Период
Сортировка
От Lincoln Yeoh
Тема Re: PostgreSQL Indexing versus MySQL
Дата
Msg-id 5.2.1.1.1.20040218183328.0274b060@mbox.jaring.my
обсуждение исходный текст
Ответ на Re: PostgreSQL Indexing versus MySQL  ("scott.marlowe" <scott.marlowe@ihs.com>)
Ответы Re: PostgreSQL Indexing versus MySQL  (Jan Wieck <JanWieck@Yahoo.com>)
Re: PostgreSQL Indexing versus MySQL  ("scott.marlowe" <scott.marlowe@ihs.com>)
Список pgsql-general
At 04:14 PM 2/17/2004 -0700, scott.marlowe wrote:
>custom type (hex, foobar, etc...) from one to another.  What this means
>too you, the user, is that:
>
>create table test (id int8, info text);
><insert 10,000 rows>
>select * from test where id=456;
>
>will result in a sequential scan.  Why?  Because the default integer type
>is int4, and your id field is int8.  Cast the value to int8, and watch it
>use an index scan:
>
>select * From test where id=cast(456 as int8);

Actually won't
select * from test where id='456'
use the index?

I'm curious if this work in all cases - e.g. postgresql figures the best
cast for text to whatever, even for relevant custom types?


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

Предыдущее
От: Lincoln Yeoh
Дата:
Сообщение: Re: Pg + perl + apache
Следующее
От: "Mark Cubitt"
Дата:
Сообщение: Differences between postgres and mysql