От: Hermann Matthes
Тема: Paged Query
Дата: ,
Msg-id: 4FF43638.5080301@web.de
(см: обсуждение, исходный текст)
Ответы: Re: Paged Query  (Віталій Тимчишин)
Re: Paged Query  ("Albe Laurenz")
Re: Paged Query  (Greg Spiegelberg)
Re: Paged Query  (Misa Simic)
Список: pgsql-performance

Скрыть дерево обсуждения

Paged Query  (Hermann Matthes, )
 Re: Paged Query  (Віталій Тимчишин, )
 Re: Paged Query  ("Albe Laurenz", )
 Re: Paged Query  (Greg Spiegelberg, )
 Re: Paged Query  (Misa Simic, )
  Re: Paged Query  (Gregg Jaskiewicz, )
   Re: Paged Query  (Craig Ringer, )
    Re: Paged Query  (Shaun Thomas, )
     Re: Paged Query  (Craig James, )
      Re: Paged Query  (Greg Spiegelberg, )
     Re: Paged Query  (Craig Ringer, )
   Re: Paged Query  (Misa Simic, )
    Re: Paged Query  (Andrew Dunstan, )
     Re: Paged Query  (Gurjeet Singh, )
    Re: Paged Query  (Віталій Тимчишин, )
    Re: Paged Query  (Віталій Тимчишин, )
 Re: Paged Query  (Misa Simic, )
  Re: Paged Query  (Craig Ringer, )
   Re: Paged Query  (Jeff Janes, )
 Re: Paged Query  (Misa Simic, )

I want to implement a "paged Query" feature, where the user can enter in
a dialog, how much rows he want to see. After displaying the first page
of rows, he can can push a button to display the next/previous page.
On database level I could user "limit" to implement this feature. My
problem now is, that the user is not permitted to view all rows. For
every row a permission check is performed and if permission is granted,
the row is added to the list of rows sent to the client.
If for example the user has entered a page size of 50 and I use "limit
50" to only fetch 50 records, what should I do if he is only permitted
to see 20 of these 50 records? There may be more records he can view.
But if I don't use "limit", what happens if the query would return
5,000,000 rows? Would my result set contain 5,000,000 rows or would the
performance of the database go down?

Thanks in advance
Hermann


В списке pgsql-performance по дате сообщения:

От: "Marc Mamin"
Дата:
Сообщение: Re: PostgreSQL db, 30 tables with number of rows < 100 (not huge) - the fastest way to clean each non-empty table and reset unique identifier column of empty ones.
От: Jeff Janes
Дата:
Сообщение: Re: PostgreSQL db, 30 tables with number of rows < 100 (not huge) - the fastest way to clean each non-empty table and reset unique identifier column of empty ones.