Re: Long running queries and timeouts

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Re: Long running queries and timeouts
Дата
Msg-id GNELIHDDFBOCMGBFGEFOOEBPCBAA.chriskl@familyhealth.com.au
обсуждение исходный текст
Ответ на Re: Long running queries and timeouts  (Chadwick Rolfs <cmr@shell.gis.net>)
Список pgsql-php
> I can see why this doesn't make much sense.  Seeing as we have nothing to
> work with from the original post regarding just what the query is.. I'll
> try to give an example to explain.
>
> querying all the names in a phone book DB:
> select first_name, last_name from white_pages;
> --UH... this will be,,,let's say 150,000 entries (small city phone book)
>
> WELL, you could select by starting letters, and put it into an array,
> using pg_fetch_array, or pg_fetch_object.  Make multiple queries in the
> same script, and use that array (or object) to ouput to the browser...
>
> select first_name, last_name from white_pages where last_name like 'A%';
> select first_name, last_name from white_pages where last_name like 'B%';
> select first_name, last_name from white_pages where last_name like 'C%';
> select first_name, last_name from white_pages where last_name like 'D%';
> ...etc
>
> if it's still too long, try 'Aa%', 'Ab%' ... so on.  Tedious, but
> efficient.

You could always just use CURSORs.  Look up 'DECLARE' and 'MOVE' and 'FETCH'
sql commands in postgres.

Chris


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

Предыдущее
От: "Brent R. Matzelle"
Дата:
Сообщение: Re: PHP Abstraction layers
Следующее
От: Manuel Lemos
Дата:
Сообщение: Re: PHP Abstraction layers