Re: [WebDNA] CORRECTION: 60% failure rate using replace in a loop

This WebDNA talk-list message is from

2010


It keeps the original formatting.
numero = 105628
interpreted = N
texte = > I think this might work faster: > > 1- Search the tickets.db for (example) 45 random sku values > 2. Stores these skus in an indexed table > 3- Search the bids.db for the next 45 records with blank > bidderID values > 4- Use replacefounditems to change these bidderID's > based on lookups of the index values in the table I ran a test using this new coding technique and it is 5 times FASTER than my old code. As far as changes are concerned, I UN-nested the searches (which probably makes the most difference) and then I removed the conditional showifs and random values in both code snippets so the test results would be valid and directly comparable. Here's an example of my new code which follows the description quoted above. If *not* nesting search contexts makes this kind of performance improvement maybe this is the approach we should all use on pages that demand the fastest processing: [search db=test/tickets.db&eqemaildatarq=XXX&raemailsort=1&max=45] [table name=set1&fields=idx,sku] [founditems][index][sku] [/founditems][/table] [/search] [search db=test/bids.db&eqbidderIDdatarq=[blank]&asidxsort=1&idxtype=num&max=45] [replacefounditems]bidTime=[time]&bidderID=[lookup table=set1&value=[index]&lookinfield=idx&returnfield=sku][/replacefounditems] [/search] Note that I did not see any failure of replacefounditems here, so whatever was causing the problem earlier is not breaking this code. :) Sincerely, Kenneth Grome Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] CORRECTION: 60% failure rate using replace in a loop (christophe.billiottet@webdna.us 2010)
  2. Re: [WebDNA] CORRECTION: 60% failure rate using replace in a loop (Kenneth Grome 2010)
  3. Re: [WebDNA] CORRECTION: 60% failure rate using replace in a loop (Kenneth Grome 2010)
  4. Re: [WebDNA] CORRECTION: 60% failure rate using replace in a loop (christophe.billiottet@webdna.us 2010)
  5. Re: [WebDNA] CORRECTION: 60% failure rate using replace in a loop (Kenneth Grome 2010)
  6. Re: [WebDNA] CORRECTION: 60% failure rate using replace in a loop (Kenneth Grome 2010)
  7. Re: [WebDNA] CORRECTION: 60% failure rate using replace in a loop (christophe.billiottet@webdna.us 2010)
  8. Re: [WebDNA] CORRECTION: 60% failure rate using replace in a loop (Kenneth Grome 2010)
  9. Re: [WebDNA] CORRECTION: 60% failure rate using replace in a loop (christophe.billiottet@webdna.us 2010)
  10. Re: [WebDNA] CORRECTION: 60% failure rate using replace in a loop (Kenneth Grome 2010)
  11. Re: [WebDNA] CORRECTION: 60% failure rate using replace in a loop (christophe.billiottet@webdna.us 2010)
  12. Re: [WebDNA] CORRECTION: 60% failure rate using replace in a loop (Kenneth Grome 2010)
  13. Re: [WebDNA] CORRECTION: 60% failure rate using replace in a loop (christophe.billiottet@webdna.us 2010)
  14. [WebDNA] CORRECTION: 60% failure rate using replace in a loop (Kenneth Grome 2010)
> I think this might work faster: > > 1- Search the tickets.db for (example) 45 random sku values > 2. Stores these skus in an indexed table > 3- Search the bids.db for the next 45 records with blank > bidderID values > 4- Use replacefounditems to change these bidderID's > based on lookups of the index values in the table I ran a test using this new coding technique and it is 5 times FASTER than my old code. As far as changes are concerned, I UN-nested the searches (which probably makes the most difference) and then I removed the conditional showifs and random values in both code snippets so the test results would be valid and directly comparable. Here's an example of my new code which follows the description quoted above. If *not* nesting search contexts makes this kind of performance improvement maybe this is the approach we should all use on pages that demand the fastest processing: [search db=test/tickets.db&eqemaildatarq=XXX&raemailsort=1&max=45] [table name=set1&fields=idx,sku] [founditems][index][sku] [/founditems][/table] [/search] [search db=test/bids.db&eqbidderIDdatarq=[blank]&asidxsort=1&idxtype=num&max=45] [replacefounditems]bidTime=[time]&bidderID=[lookup table=set1&value=[index]&lookinfield=idx&returnfield=sku][/replacefounditems] [/search] Note that I did not see any failure of replacefounditems here, so whatever was causing the problem earlier is not breaking this code. :) Sincerely, Kenneth Grome Kenneth Grome

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Anyone using unix? Having problems... (2000) Problems passing [SKU] with $Replace in 2.0 (1997) I'm Baaaaaaaaaack - Questions! (2000) flushdatabases (2000) I forgot (1998) DataBaseHelper Flawed (1997) WebCat2b12 - nesting [tags] (1997) Emailer update for Mac? (1998) Triggers (1999) Interpret twice? (1997) Only charge card when product shipped ? (1997) Giving out error pages (1997) browsername (2002) quitting (1997) Formulas (2001) Bad Cookie / Internet Option / Internet Explorer (2004) Date search - yes or no (1997) WebCat cannot handle compatible search parameters? (1997) carriage returns in data (1997) [WebDNA] Brian Harrington (2019)