What's faster?

Поиск
Список
Период
Сортировка
От Silas Justiniano
Тема What's faster?
Дата
Msg-id 1139456715.177179.159300@o13g2000cwo.googlegroups.com
обсуждение исходный текст
Ответы Re: What's faster?  (Chris <dmagick@gmail.com>)
Re: What's faster?  (Alban Hertroys <alban@magproductions.nl>)
Re: What's faster?  ("Uwe C. Schroeder" <uwe@oss4u.com>)
Список pgsql-general
Hello all!

I'm performing a query that returns me hundreds of records... but I
need cut them in pages that have 15 items! (using PHP)

So, is it faster:

  select blablabal from _complex_query
  if (count($result) > 15) show_pages;
  show_only_15_rows($result);

or:

  select count(*) from _complex_query
  if ($result1 > 15) show_pages;
  select blablabal from _complex_query LIMIT ... (see the LIMIT!)
  show $result

On the first, I can use pg_num_rows instead of count(), too.

what do you think?

Thank you!


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

Предыдущее
От: Rodolfo Campos
Дата:
Сообщение: Re: Insert into other database
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Request to have VACUUM ignore cost based limits