pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feedLow disk performance?
2+ messages / 2 participants
[nested] [flat]
* Low disk performance?
@ 2010-11-18 11:09 Martin Chlupac <martin.chlupac@rcware.eu>
0 siblings, 1 reply; 2+ messages in thread
From: Martin Chlupac @ 2010-11-18 11:09 UTC (permalink / raw)
To: pgsql-performance
Hello everybody,
having this SQL query:
--------------
select variable_id,float_value,ts,good_through,interval,datetime_value,string_value,int_value,blob_value,history_value_type
from "records_437954e9-e048-43de-bde3-057658966a9f" where variable_id
in (22727) and (ts >= '2010-10-02 11:19:55' or good_through >=
'2010-10-02 11:19:55') and (ts <= '2010-10-14 11:19:55' or
good_through <= '2010-10-14 11:19:55')
union all
select variable_id,float_value,ts,good_through,interval,datetime_value,string_value,int_value,blob_value,history_value_type
from "records_1d115712-e943-4ae3-bb14-b56a95796111" where variable_id
in (24052) and (ts >= '2010-10-02 11:19:55' or good_through >=
'2010-10-02 11:19:55') and (ts <= '2010-10-14 11:19:55' or
good_through <= '2010-10-14 11:19:55')
order by ts
limit 2501 offset 0
---------------
and these two results:
1st run:
http://explain.depesz.com/s/1lT
2nd run:
http://explain.depesz.com/s/bhA
is there anything I can do about the speed? Only buying faster
hard-disk seems to me as the solution... Am I right?
Thank you in advance
Martin
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Low disk performance?
@ 2010-11-18 13:33 tv@fuzzy.cz
parent: Martin Chlupac <martin.chlupac@rcware.eu>
0 siblings, 0 replies; 2+ messages in thread
From: tv@fuzzy.cz @ 2010-11-18 13:33 UTC (permalink / raw)
To: Martin Chlupac <martin.chlupac@rcware.eu>; +Cc: pgsql-performance
Hi, what is the size of the table and index (in terms of pages and
tuples)? Try something like
SELECT relpages, reltuples FROM pg_class WHERE relname = 'table or index
name';
And what indexes have you created? It seems to me there's just index on
the variable_id. It might be useful to create index on (variable_id, ts)
or even (variable_id, ts, good_through).
Tomas
> Hello everybody,
> having this SQL query:
>
> --------------
> select
> variable_id,float_value,ts,good_through,interval,datetime_value,string_value,int_value,blob_value,history_value_type
> from "records_437954e9-e048-43de-bde3-057658966a9f" where variable_id
> in (22727) and (ts >= '2010-10-02 11:19:55' or good_through >=
> '2010-10-02 11:19:55') and (ts <= '2010-10-14 11:19:55' or
> good_through <= '2010-10-14 11:19:55')
> union all
> select
> variable_id,float_value,ts,good_through,interval,datetime_value,string_value,int_value,blob_value,history_value_type
> from "records_1d115712-e943-4ae3-bb14-b56a95796111" where variable_id
> in (24052) and (ts >= '2010-10-02 11:19:55' or good_through >=
> '2010-10-02 11:19:55') and (ts <= '2010-10-14 11:19:55' or
> good_through <= '2010-10-14 11:19:55')
> order by ts
> limit 2501 offset 0
>
> ---------------
>
> and these two results:
>
> 1st run:
> http://explain.depesz.com/s/1lT
>
> 2nd run:
> http://explain.depesz.com/s/bhA
>
> is there anything I can do about the speed? Only buying faster
> hard-disk seems to me as the solution... Am I right?
>
> Thank you in advance
> Martin
>
> --
> Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-performance
>
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2010-11-18 13:33 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-11-18 11:09 Low disk performance? Martin Chlupac <martin.chlupac@rcware.eu>
2010-11-18 13:33 ` tv@fuzzy.cz
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