Re: Very slow query (3-4mn) on a table with 25millions rows

From: Martín Marqués <martin(at)2ndquadrant(dot)com>
To: Abadie Lana <Lana(dot)Abadie(at)iter(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Very slow query (3-4mn) on a table with 25millions rows
Date: 2016-07-26 10:34:17
Message-ID: 24ade69a-70bf-4cb1-75ae-03a5481f067a@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

El 26/07/16 a las 06:01, Abadie Lana escribió:
> Hi Tom,
> Thanks for the hints..
>
> I made various tests for index
> The best I could get is the following one with
> create index vat_funcvaratt_multi_idx on functionalvarattributes(split_part(split_part(attvalue,' ',1),'.',1), tag_id, atttype_id);
> analyze functionalvarattributes;

I suggest running analyze over the other tables involved in the query
(or over the whole DB) and then sending back the explain analyze, or
even better EXPLAIN (ANALYZE,BUFFERS).

Some estimates are close and others are really wrong.

I'm not saying that's going to give you a big bust but we'll be able to
see the planner with fresh stats

--
Martín Marqués http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Abadie Lana 2016-07-27 06:03:22 Re: Very slow query (3-4mn) on a table with 25millions rows
Previous Message Abadie Lana 2016-07-26 09:01:24 Re: Very slow query (3-4mn) on a table with 25millions rows