Thanks for the suggestions, I'll futz with random_page_cost and
effective_cache_size a bit and follow up, as well as try to provide an
explain analyze on both (if the longer query ever returns!)
Most appreciated.
On Wed, Sep 13, 2017 at 4:57 PM, David Rowley
wrote:
> On 14 September 2017 at 08
With this query I am trying to get the latest hour for a given timestamp so
that I can get whole health array of all object for a given hour. So I am
doing DISTINCT on mobid and order by hour and mobid DESC.
On Thu, Sep 14, 2017 at 6:03 PM, Subramaniam C
wrote:
> I created index on morbid and ho
I created index on morbid and hour together. Given below is the EXPLAIN
output
--
Unique (cost=606127.16..621098.42 rows=1087028 width=200)
-> Sort (cost=606127.16..613612.79 rows=2994252 width=200)
On 2017-09-14 13:51, Subramaniam C wrote:
Hi
QUERY :-
_select distinct on (health_timeseries.mobid) mobid,
health_timeseries.health, health_timeseries.hour from
health_timeseries where hour >=(1505211054000/(3600*1000))-1 and hour
<= 1505211054000/(3600*1000) ORDER BY health_timeseries.mobid DE
Hi
*Requirement :- *
We need to retrieve latest health of around 1.5 million objects for a given
time.
*Implementation :-*
We are storing hourly data of each object in single row. Given below is the
schema :-
*CREATE TABLE health_timeseries (*
* mobid text NOT NULL,
hour bigint NOT