From: samantha mahindrakar <sam.mahindrakar@gmail.com>
To: pgsql-performance@postgresql.org
Subject: Query running slow
Date: Wed, 16 Apr 2008 17:14:11 -0400
Message-ID: <f0c828c40804161414u731aea46h35207eec1278c51c@mail.gmail.com> (raw)
Hi....
Iam finding the following query is working a bit slow:
EXECUTE '(SELECT ARRAY(SELECT DISTINCT date_part(''day'', measurement_start)
FROM ' || gettablestring(dates)|| '
WHERE lane_id IN (' || lanesidarr || ')))'
INTO temparr;
This function is trying to find all the days in a prticular month
whihc has data for the particular lane and put it in an array...which
can be used later.
gettablestring(dates) returns the partition name from which the data
needs to be extracted. These partitions have index on the
measurement_start field.
lanesidarr is a lane number. The partition has an index on this field to.
Could anyone give me some hints???/
Thanks
Sam
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: sam.mahindrakar@gmail.com
Subject: Re: Query running slow
In-Reply-To: <f0c828c40804161414u731aea46h35207eec1278c51c@mail.gmail.com>
References: <f0c828c40804161414u731aea46h35207eec1278c51c@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox