question about performance

Поиск
Список
Период
Сортировка
От Robert Urban
Тема question about performance
Дата
Msg-id 48837F15.5010401@unix-beratung.de
обсуждение исходный текст
Ответы Re: question about performance  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Re: question about performance  (Alan Hodgson <ahodgson@simkin.ca>)
Список pgsql-general
Hi PostgreSQLer,

if I have a table, the_table, with a DATE field, i'll call it 'day', and I'd
like to find all rows whos day falls within a given month, which of the
following methods is faster/costs less:

1.

    SELECT * FROM the_table WHERE day LIKE '2008-01-%';

2.

    SELECT * FROM the_table
        WHERE ( day BETWEEN '$month_begin' AND '$month_end' );

    # where $month_begin is '2008-01-01' and $month_end is '2008-01-31';

thanks,

Rob Urban

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

Предыдущее
От: "Pavel Stehule"
Дата:
Сообщение: Re: Writing a user defined function
Следующее
От: "A. Kretschmer"
Дата:
Сообщение: Re: question about performance