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:

Sorting Round 2 plus (1998) [LookUp] (1999) about this server and links to who (1997) strange problem listfiles and movefile (long) (2000) Exclude by date - multiple (1997) Add - optional parameters textA=.... (1997) Performance Issue (2000) OT: visudo help (2003) WCS Newbie question (1997) cart info (1998) Sendmail question [Newbie] (1999) Searching (second post) (1999) WebCat Beta NT 18 (1997) range searching (1998) Users and groups for local directories (1999) suggestion (1997) corrupted jpgs (2003) Payment Processors (2005) access denied problem (1997) Need help with emailer- 2 issues (1997)