0

I'm trying to develop a on type search component on Account object and stumbled upon using this query

SELECT Name
FROM Account
ORDER BY Name DESC NULLS LAST

As you can see from the above query I'm ordering by Name field. My question is Name(Indexed) field on Account is always required so does it have any negative effects doing DESC NULLS LAST if the volume of Account records in my org is higher say 1 million.

0

1 Answer 1

2

Assuming you're filtering your query, the NULLS (FIRST|LAST) operator won't have any negative side effects. Just remember to filter/limit your query, and you'll be fine.

2
  • I'm actually using that plain query without any filters.By your answer above I think I'd run into issues
    – sai kumar
    Mar 13, 2018 at 18:25
  • @saikumar Yes, remember that you've got a 50k row governor limit. You can't just load a million records into your component, it won't work very well. Keep it under some reasonable value like 50 or 100.
    – sfdcfox
    Mar 13, 2018 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.