dbTalk Databases Forums  

[NOVICE] how to leverage index for order by

mailing.database.pgsql-novice mailing.database.pgsql-novice


Discuss [NOVICE] how to leverage index for order by in the mailing.database.pgsql-novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
sreeaurovindh viswanathan
 
Posts: n/a

Default [NOVICE] how to leverage index for order by - 03-22-2012 , 09:29 PM






Hi,

I have about 140 million columns and would like to sort multiple
columns.(This is in a way a one time process).But I would like to get
the results atleast within a day time frame.
For example

I have a table which has five columns all are numbers except one column.

id bigserial
qid numeric
kid numeric
dId numeric
uId text.

I am trying to do something like this.

select * from schema.table1 order by qid desc,kid asc,dId desc

Please explain on how do create and leverage that index for sorting.

I tried in the following manner to come up with an index but my above
query did not use this index

create index myIndex on table1(qid asc)


thanks
Sree aurovindh V

Thanks

--
Sent via pgsql-novice mailing list (pgsql-novice (AT) postgresql (DOT) org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.