Help understanding indexes

Поиск
Список
Период
Сортировка
От chris.gamble@CPBINC.com
Тема Help understanding indexes
Дата
Msg-id 00CA54A79070D411A9E20090273CEF1C14F32A@inet1.cpbinc.com
обсуждение исходный текст
Ответы Re: Help understanding indexes  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
I am working on a project that will use a large database (11 million
records). I have the following fields:

customerid     bigint
longitude    float8
latitude        float8

my indexes are:

idxcust        on customerid
idxloc        on longitude, latitude

I run queries like
SELECT * FROM tdatcustomerlist WHERE customerid=4237095

but postgres will not use my indexes. I have found the workaround here as:
SELECT * FROM tdatcustomerlist WHERE customerid=4237095::BIGINT

but this is not very portable sql.

also, i have a query that tries to do greater than less than queries against
long / lat fields, but I have not yet discovered a way to get those queries
to use indexes. I have tried using the float8gt/lt functions, and tried
using type casting. Does anyone have helpful explanations???




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

Предыдущее
От: Manfred Koizar
Дата:
Сообщение: Re: Updates are slow..
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Help understanding indexes