Hi Andy, we have applied the optional patches. We migrated from 4.2 to 5.1 and ever since our select queries have been far slower. In 4.2 we could retrieve 1000 documents in 20 seconds, but in 5.1 that same query on the same data set take up to 66 seconds.
This sounds like it should be a support case - there is no way this question can really be answered with the information provided. It requires a methodical investigation to get to the cause and a solution.
First - why does this query take 20s in the first place? That is already more than I would expect.
What is the query?
What data is it supposed to match?
How many nodes does the query actually consider? (You may be pulling back the top 1000 after sorting 100M)
Are all queries slow - or - just this one?
What is the DB query and plan?
Of the 20s how much of the time is the DB query?
What else is the DB doing?
There could be any number of issues here from the data architecture and the data model and how you planned to find stuff - all the way down to the database execution of the query. I think you should sort out the starting point before worrying about comparing the environments, database configuration, etc.