Last active
September 7, 2018 20:32
-
-
Save ivanionut/76ce7e81f2c45cd2f260474aad9c6167 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
max=10000; | |
persons = queryNew( | |
"lastname, firstname", | |
"cf_sql_varchar, cf_sql_varchar", | |
[ | |
[ "Lebowski", "Jeffrey" ], | |
[ "Lebowski", "Bunny" ], | |
[ "Lebowski", "Maude" ], | |
[ "Sobchak", "Walter" ] | |
] | |
); | |
// Query of Query | |
start=getTickCount(); | |
for (i = 1; i <= max; i++) { | |
queryExecute( | |
"select * from persons | |
where lastname='Lebowski' | |
and firstname='Bunny' | |
order by lastname ", | |
{}, | |
{dbtype="query"} | |
); | |
} | |
writeoutput("Query of Query Execution Time:"&(getTickCount()-start)); | |
// Query Filter/Sort | |
start=getTickCount(); | |
for (i = 1; i <= max; i++) { | |
qf=queryFilter(persons,function (row,cr,qry) {return row.firstname=='Bunny' && row.lastname=='Lebowski';}); | |
qs=qf.sort(function(rowA, rowB) { return compare(rowA.lastname, rowB.lastname); }); | |
} | |
writeoutput("<br>Query Filter/Sort Execution Time:"&(getTickCount()-start)); | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment