On 3/22/12 11:02 AM, sreeaurovindh viswanathan wrote:
> Hi,
>
> If I have three columns in a table and if i wish to sort based on one
> field and then on the other what would be the recommended method.I
> would be sorting atleast 75,00,000 records at a time.
>
> ie I would like to use something equivalent the following sql query.
>
> Select * from sample.table order by query desc,keyword asc.
Provided that you have created a CSI index on this field, there are a 
couple of ways for doing this:

1) Table.itersorted(): retrieves the table records in sorted order

2) Table.readSorted(): retrieves the complete sorted table as a 
monolithic structured array

Both methods follow ascending order by default.  Choose a step=-1 for 
choosing a descending order.

-- Francesc Alted

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to