pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feedOrder By Clause, Slows Query Performance?
3+ messages / 3 participants
[nested] [flat]
* Order By Clause, Slows Query Performance?
@ 2013-11-10 07:40 monalee_dba <monalee@sungraceinfotech.co.in>
2013-11-13 01:31 ` Re: Order By Clause, Slows Query Performance? Michael Paquier <michael.paquier@gmail.com>
2013-11-13 09:07 ` Re: Order By Clause, Slows Query Performance? Albe Laurenz <laurenz.albe@wien.gv.at>
0 siblings, 2 replies; 3+ messages in thread
From: monalee_dba @ 2013-11-10 07:40 UTC (permalink / raw)
To: pgsql-performance
Eg. SELECT col1, col2, col3,....col10 FROM table1;
For above query If I didn't mention ORDER BY clause, then I want to know
selected data will appear in which order by a query planner?
Because I have huge size table, and when I applied ORDER BY col1, col2..in
query the
performance is soo bad that I can't offred.
What should I do ? Because my requirement is data with ordered column.
--
View this message in context: http://postgresql.1045698.n5.nabble.com/Order-By-Clause-Slows-Query-Performance-tp5777633.html
Sent from the PostgreSQL - performance mailing list archive at Nabble.com.
--
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] 3+ messages in thread
* Re: Order By Clause, Slows Query Performance?
2013-11-10 07:40 Order By Clause, Slows Query Performance? monalee_dba <monalee@sungraceinfotech.co.in>
@ 2013-11-13 01:31 ` Michael Paquier <michael.paquier@gmail.com>
1 sibling, 0 replies; 3+ messages in thread
From: Michael Paquier @ 2013-11-13 01:31 UTC (permalink / raw)
To: monalee_dba <monalee@sungraceinfotech.co.in>; +Cc: pgsql-performance
On Sun, Nov 10, 2013 at 4:40 PM, monalee_dba
<monalee@sungraceinfotech.co.in> wrote:
> Eg. SELECT col1, col2, col3,....col10 FROM table1;
>
> For above query If I didn't mention ORDER BY clause, then I want to know
> selected data will appear in which order by a query planner?
The data will be selected in the order at which it is scanned.
> Because I have huge size table, and when I applied ORDER BY col1, col2..in
> query the
> performance is soo bad that I can't offred.
> What should I do ? Because my requirement is data with ordered column.
Redesign your application. The larger your relation "table1" would
get, the more data you would fetch and the slower it would get. The
best advice I got here would be first to analyze why you need to fetch
that much data back to your application. Particularly, if your
application fetches that much data and post-treats it internally, you
should try to maximize such processing on the database server side and
not the application side to minimize the amount of data exchanged
between the database server and the application client.
Note that you might as well consider changing your schema.
--
Michael
--
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] 3+ messages in thread
* Re: Order By Clause, Slows Query Performance?
2013-11-10 07:40 Order By Clause, Slows Query Performance? monalee_dba <monalee@sungraceinfotech.co.in>
@ 2013-11-13 09:07 ` Albe Laurenz <laurenz.albe@wien.gv.at>
1 sibling, 0 replies; 3+ messages in thread
From: Albe Laurenz @ 2013-11-13 09:07 UTC (permalink / raw)
To: monalee_dba *EXTERN* <monalee@sungraceinfotech.co.in>; pgsql-performance
monalee_dba wrote:
> Eg. SELECT col1, col2, col3,....col10 FROM table1;
>
> For above query If I didn't mention ORDER BY clause, then I want to know
> selected data will appear in which order by a query planner?
>
> Because I have huge size table, and when I applied ORDER BY col1, col2..in
> query the
> performance is soo bad that I can't offred.
> What should I do ? Because my requirement is data with ordered column.
A B-Tree index may help with that:
http://www.postgresql.org/docs/current/static/indexes-ordering.html
Consider a multicolumn index.
Yours,
Laurenz Albe
--
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] 3+ messages in thread
end of thread, other threads:[~2013-11-13 09:07 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-11-10 07:40 Order By Clause, Slows Query Performance? monalee_dba <monalee@sungraceinfotech.co.in>
2013-11-13 01:31 ` Michael Paquier <michael.paquier@gmail.com>
2013-11-13 09:07 ` Albe Laurenz <laurenz.albe@wien.gv.at>
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