Re: Order By Clause, Slows Query Performance?

From: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "monalee_dba *EXTERN*" <monalee(at)sungraceinfotech(dot)co(dot)in>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Order By Clause, Slows Query Performance?
Date: 2013-11-13 09:07:11
Message-ID: A737B7A37273E048B164557ADEF4A58B17C591A5@ntex2010i.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Torsten Förtsch 2013-11-13 09:37:46 Re: BitMap Heap Scan & BitMap Index Scan
Previous Message Tom Lane 2013-11-13 01:46:40 Re: Performance bug in prepared statement binding in 9.2?