Hi Matheus:

Thanks for your prompt answer. It's for a web application. This part of the application allows to export the answers to a CSV file. So pagination isn't possible here. The user can choose among several filters. The group of the courses is one of them. She can combine as many filters as she wants. So the query that I presented in my previous message was one of the "broadest" examples. But it's the one that I'm interested in.

Really, I'm more interested in the relative time than in the absolute time. Because I could create the file asynchronously, in the background, so that the user downloaded it at a later time. That's not the problem. My doubt is if 2.8 seconds is the best that I can do. Is it an acceptable time?

Thank you! ;)


On 19/10/16 13:15, Matheus de Oliveira wrote:

On Wed, Oct 19, 2016 at 8:54 AM, negora <public@negora.com> wrote:
    Nested Loop  (cost=245.92..383723.28 rows=7109606 width=38) (actual
time=1.091..2616.553 rows=8906075 loops=1)

I wonder about the use-case for this query, because it returns more than 8M rows, so 2.6 seconds that sounds that much for so many rows. Is it for an end user application? Isn't there any kind of pagination?


--
Matheus de Oliveira