Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

Where will sorting be happening when sql query will run?

user-image
Question added by suresh babu manukonda , Database Lead , creditsafe
Date Posted: 2016/03/25
Arshad Jamil
by Arshad Jamil , ERP Engineer / Application Developer , Security Forces Hospital - Dammam

Sorting may be in ascending or descending order, based on Order by clause in query. the requested sorting is done on Server machine once records are fetched.

in oracle ........in sorting assending or desending in ORDER BY CLAUSE.....

mohammed السبع
by mohammed السبع , chemist , health insurance

it will be sorted in ascending order unless you change it in order by clause

If Order By clause is not imposed, it automatically use the ID or Primary Key for sorting.

Muhammad Ahmed
by Muhammad Ahmed , Assistant Manager , Treet Group of Corporation Lahore

We will define it at the end of query but qurey will run from end to start.

The database table has a index cache that uses for accessing the value of any row, when we run the sql query by using the order by clause for index column then it sort asc or desc by user requirment , and also it uses the tempspace for sorting,in case no index column uses then it checks the alphabet or numbers. 

Syed Mohammad khalid Anwer
by Syed Mohammad khalid Anwer , Technical Database Administrator , Oracle India Pvt L t d (Net Connect Global)

It uses SQL Work Areas (a component of PGA) .

VENKATESH NADIPINENI
by VENKATESH NADIPINENI , Senior Project Engineer , WIPRO ARABIA LTD

When you run the SQL with order by clause it uses the index cache if we use indexed cloumn. In case there is no index on column which defined in order by clause, sorting will happen tempspace/data cache ,

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.