Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

performance issue

Former Member
0 Likes
700

according to performance tuning waht should i use ?

SELECT SINGLE or SELECT UPTO ONE ROW?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
678

If you can satisfy the pimary key then select single else select upto one row

thanks

7 REPLIES 7
Read only

Former Member
0 Likes
678

select single if you have the full key to be passed to the where condition.

Read only

Former Member
0 Likes
679

If you can satisfy the pimary key then select single else select upto one row

thanks

Read only

Former Member
0 Likes
678

hi

select single performs better if u have full keys used in the where condition.

otherwise...go for slect upto 1 row.

regards,

madhu

Read only

Former Member
0 Likes
678

i think select single because it is hitting the database only one time but select...upto one rows hitting the database multiple times for satisfying where clause. Generally if you can specify full key in your where clause use select single.

regards'

shiba dutta

Read only

Former Member
0 Likes
678

select single : returns the first matching row for the given condition and it may not be unique, if there are more matching rows for the given condition.

select up to 1 rows : retrieves all the matching records and applies aggregation and ordering and returns the first record.

In order to check for the existence of a record then it is better to use <b>select single</b> than using <b>select up to 1 rows</b> since it uses low memory and has better performance.

Read only

Former Member
0 Likes
678
Read only

Former Member
0 Likes
678

Hi,

select single is a construct designed to read database records with primary key. In the absence of the primary key, it might end up doing a sequential search, whereas the select up to 1 rows may assume that there is no primary key supplied and will try to find most suitable index.

Regards,

Sruthi