Jump to content

Execution time and sorting pages array: find("id=....") vs getById()


OLSA
 Share

Recommended Posts

Hello for all,

don't know if this is interesting to someone:
 

//pseudocode example (inside some module)
//we have some pages array (5 to 10 pages)

wire('pages')->find('id=1111|2222|...'); // 0.050s, and ordering is not like selected
wire('pages')->getById( array(1111,2222,...) ); // 0.035s, and ordering is exactly like selected

It seems that query with "getById" is somehow faster and ordering is correct.

Regards

 

  • Like 6
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...