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:

WebCat2.0 acgi vs plugin (1997) First postarg not taking in $Commands (1997) Changing price for a SLU based on options (size, etc.) (1997) WC2f3 (1997) WebCat2 beta 11 - new prefs ... (1997) WCS Newbie question (1997) PIXO Support (1997) Use WebCat to search files in a folder like a search engine? (2001) Opening 'order file'. (1999) WebCat2final1 crashes (1997) Unique SKU Numbers (2000) Sorting Orders (1997) Authenticate (1997) Stopping a [Loop] in mid-stream ... (1997) WebCat2 beta 11 - new prefs ... (1997) PCS Frames (1997) showif (2000) Templates for Customer Database? (1997) Roundup function? (1997) two unique banners on one page (1997)