Re: struct lookup vs. query of queries

2010-07-14 Thread Gerald Guido
My experience with this is that QoQ are are (really) slow when compared with using structs or arrays. I had a one experience where it brought execution time down from 15-20 seconds using QoQ to 1 or 2 seconds for an array. Generally I create an array of the values I want to look up.

Re: struct lookup vs. query of queries

2010-07-14 Thread Cameron Childress
On Tue, Jul 13, 2010 at 12:19 PM, Michael Dinowitz mdino...@houseoffusion.com wrote: I've got a loop which will need to look up a piece of data on each iteration. The data is standardized so there is really just one call to the database (outside the loop). I can either do a query of queries

RE: struct lookup vs. query of queries

2010-07-14 Thread DURETTE, STEVEN J (ATTASIAIT)
...@gmail.com] Sent: Wednesday, July 14, 2010 10:27 AM To: cf-talk Subject: Re: struct lookup vs. query of queries On Tue, Jul 13, 2010 at 12:19 PM, Michael Dinowitz mdino...@houseoffusion.com wrote: I've got a loop which will need to look up a piece of data on each iteration. The data

Re: struct lookup vs. query of queries

2010-07-14 Thread Michael Grant
Subject: Re: struct lookup vs. query of queries On Tue, Jul 13, 2010 at 12:19 PM, Michael Dinowitz mdino...@houseoffusion.com wrote: I've got a loop which will need to look up a piece of data on each iteration. The data is standardized so there is really just one call to the database

Re: struct lookup vs. query of queries

2010-07-14 Thread Cameron Childress
On Wed, Jul 14, 2010 at 10:54 AM, DURETTE, STEVEN J (ATTASIAIT) sd1...@att.com wrote: Correct me if I'm wrong (please) but isn't a query already a Struct of Arrays? It is, but you can really only use that to select data based on a column name and row number. Typically, if I were to convert a

Re: struct lookup vs. query of queries

2010-07-13 Thread Mike Chabot
I think the size of the query and structure would be an important factor, as well as how many loop iterations are done. Often I lean towards using structures if I need to look up data frequently because the syntax is cleaner. There is also the array method of accessing queries like

Re: struct lookup vs. query of queries

2010-07-13 Thread Michael Grant
Can you accomplish the same thing in the db? I would feel pretty confident saying that unless you've got an unusual table it's going to be faster to use the db for you data comparison. On Tue, Jul 13, 2010 at 12:19 PM, Michael Dinowitz mdino...@houseoffusion.com wrote: I've got a loop

Re: struct lookup vs. query of queries

2010-07-13 Thread Dan G. Switzer, II
Depending on the size of the lookup table, I like using a struct to hold a reference to the row number, that way I quickly lookup the data in the query. Lookup = structNew(); Lookup[id] = row; then you can do: query.column[Lookup[id]]; -Dan On Tuesday, July 13, 2010, Michael Dinowitz