Help with slow query - Pgsql 9.2

From: Patrick B <patrickbakerbr(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Help with slow query - Pgsql 9.2
Date: 2016-09-06 01:53:34
Message-ID: CAJNY3itmCUZupsqqgLs1FiQ-T4HRJfVANFXHvvZEQey00hwrmA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi guys,

I got this query:

> SELECT id,jobid,description,serialised_data
> FROM logtable
> WHERE log_type = 45
> AND clientid = 24011
> ORDER BY gtime desc

Explain analyze: https://explain.depesz.com/s/XKtU

So it seems the very slow part is into:

-> Bitmap Index Scan on "ix_client" (cost=0.00..5517.96
> rows=367593 width=0) (actual time=2668.246..2668.246 rows=356327 loops=1)
> Index Cond: ("clientid" = 24011)

Am I right? The query is already using an index on that table... how could
I improve the performance in a query that is already using an index?

Thanks
Patricl

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ryan Murphy 2016-09-06 03:43:00 Re: postgres question: Views with duplicate field names
Previous Message Ryan Murphy 2016-09-06 00:03:00 Re: postgres question: Views with duplicate field names