Louis-Philippe Bedard
Member since Jun 15, 2011
- Profile: /members/8501-louis-philippe-bedard.htm
- Comments: 10
Recent Blog Comments By Louis-Philippe Bedard
-
Ask Ben: Getting The Date Based On The Year And Week In ColdFusion
Posted on Jun 24, 2011 at 3:39 PM
I just had to add an extra parameter to get the day of month based on the year, week and day of week Extra parameter: <cfargument name="Day" type="numeric" required="false" hint="The day of week we are looking at (0-6)." /> And just before... read more »
-
ColdFusion Query-Of-Queries vs. The Group Attribute In CFOutput
Posted on Jun 16, 2011 at 8:40 AM
I was still asking myself for alternative when I came up with another solution. No QoQ, no structure, so sub-select in initial query... Save the songs into a variable while calculating how many there are for that singer and display them after. <cfoutput query="allSongs" group=&... read more »
-
ColdFusion Query-Of-Queries vs. The Group Attribute In CFOutput
Posted on Jun 15, 2011 at 4:12 PM
I have split the DB query and CF execution time Ben (CFoutput Groups): Query: 27 ms CF: 9 ms Total: 36 ms Ben (Queries of Query): Queries (2): 25 ms CF: 258 ms Total: 283 ms LP (Structures): Query: 16 ms CF: 35 ms Total: 51 ms Scott (CFoutput Groups): Query: 43 ms CF: 7 ms Total: 50 ms Note tha... read more »
-
ColdFusion Query-Of-Queries vs. The Group Attribute In CFOutput
Posted on Jun 15, 2011 at 3:50 PM
@Dave, If you could post the script to add an index, that would be awesome. I'm testing on MySQL 5.... read more »
-
ColdFusion Query-Of-Queries vs. The Group Attribute In CFOutput
Posted on Jun 15, 2011 at 3:42 PM
I forgot to mention that the queries (database) were not in the benchmark time. Here is the result with database time: Ben (CFoutput Groups): 28 ms Ben (Queries of Query): 677 ms LP (Structures): 55 ms Scott (CFoutput Groups): 2160 ms The costly part of the query is: (SELECT COUNT(singerId) FROM ... read more »
-
ColdFusion Query-Of-Queries vs. The Group Attribute In CFOutput
Posted on Jun 15, 2011 at 3:28 PM
@Scott, I benchmark the 4 solutions with more data and yours is the fastest. Singers : 210 Songs : 2570 Ben (CFoutput Groups): 5 ms Ben (Queries of Query): 650 ms Mine (Structures): 20 ms Yours (CFoutput Groups): 7 ms... read more »
-
ColdFusion Query-Of-Queries vs. The Group Attribute In CFOutput
Posted on Jun 15, 2011 at 2:45 PM
@Scott, You are right on this one. I just tested your code and it's as fast as structure in that case. Thank you for that solution.... read more »
-
ColdFusion Query-Of-Queries vs. The Group Attribute In CFOutput
Posted on Jun 15, 2011 at 2:23 PM
@Scott, I agree that there is a little more work to do achieving the same thing with structure and it's a case by case basis. But I did test the 3 solutions with GetTickCount() and the QoQ was taking ~11ms while structure was taking ~1ms. Grouping was taking ~1ms as well, but in main Ben's exampl... read more »
-
ColdFusion Query-Of-Queries vs. The Group Attribute In CFOutput
Posted on Jun 15, 2011 at 1:52 PM
@Dave, I don't know if your post was referring to mine about performance, but QoQ refers to internal CF queries, not database access. So performance can be calculated on the CF part of the code. Indexes sure help on DB side, but nothing can be done on CF side about indexes on QoQ. The main plan ... read more »
-
ColdFusion Query-Of-Queries vs. The Group Attribute In CFOutput
Posted on Jun 15, 2011 at 12:40 PM
Hi Ben, Using QoQ is costly especially when there is a lot of records. Another alternative is to build a structure first, and then loop through that structure to display elements. The count is also available in that case. From a performance stand point, in this example, structure is 1000% ... read more »