Index to help ordering?

From: James David Smith <james(dot)david(dot)smith(at)gmail(dot)com>
To: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Index to help ordering?
Date: 2014-01-17 16:41:26
Message-ID: CAMu32ABf1ErgVvou_RuUB89BVeF0O5oViU_Hfsq4MT3o1AhogA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Dear all,

I have a table of some 100m rows of data. There are 5 columns of data.
When I want to look at this data I typically want to sort it by ppid
(numeric) an then by time (timestamp). This simple select can often
take 15-20 seconds. Would adding an index to these two columns make it
quicker? What is the best way to achieve increased speed for this
common select query?

Thanks

James

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Daniel Staal 2014-01-17 20:47:44 Re: Index to help ordering?
Previous Message Sameer Kumar 2014-01-17 02:56:56 Re: archive_cleanup_command when is called?