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 = 105621
interpreted = N
texte = Here's the code in my trigger template which is requested once per second. Instead of trying to create 45 new records in a couple of seconds I have resorted to creating only 1-4 new records per second (although I want to create many more for a truly realistic auction simulation). The tickets.db holds all the bidderID (sku) values. I need to search this db and retrieve a series of random bidderID's for the replace contexts: *************************************************************** [hideif [getchars start=4&end=5][time][/getchars]\2] [showif [getchars start=7&end=8][time][/getchars]\11] [search db=test/tickets.db&eqemaildatarq=XXX&raemailsort=1&max=[math]ceil((1+[random])/25)[/math]][founditems] [replace db=test/bids.db&eqbidderIDdatarq=[blank]&asidxsort=1&idxtype=num&max=1]bidTime=[time]&bidderID=[sku][/replace] [/founditems][/search] [/showif] [/hideif] [showif [getchars start=4&end=5][time][/getchars]\6] [showif [getchars start=7&end=8][time][/getchars]\17] [search db=test/tickets.db&eqemaildatarq=XXX&raemailsort=1&max=[math]ceil((1+[random])/25)[/math]][founditems] [replace db=test/bids.db&eqbidderIDdatarq=[blank]&asidxsort=1&idxtype=num&max=1]bidTime=[time]&bidderID=[sku][/replace] [/founditems][/search] [/showif] [/showif] *************************************************************** Naturally I cannot use this technique with replacefounditems because I'm searching in a different db than where the records need to be replaced. But there may be another way to approach this problem. 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 don't know if this will be faster or not, but it's probably worth a try as soon as I have some free time again. 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)
Here's the code in my trigger template which is requested once per second. Instead of trying to create 45 new records in a couple of seconds I have resorted to creating only 1-4 new records per second (although I want to create many more for a truly realistic auction simulation). The tickets.db holds all the bidderID (sku) values. I need to search this db and retrieve a series of random bidderID's for the replace contexts: *************************************************************** [hideif [getchars start=4&end=5][time][/getchars]\2] [showif [getchars start=7&end=8][time][/getchars]\11] [search db=test/tickets.db&eqemaildatarq=XXX&raemailsort=1&max=[math]ceil((1+[random])/25)[/math]][founditems] [replace db=test/bids.db&eqbidderIDdatarq=[blank]&asidxsort=1&idxtype=num&max=1]bidTime=[time]&bidderID=[sku][/replace] [/founditems][/search] [/showif] [/hideif] [showif [getchars start=4&end=5][time][/getchars]\6] [showif [getchars start=7&end=8][time][/getchars]\17] [search db=test/tickets.db&eqemaildatarq=XXX&raemailsort=1&max=[math]ceil((1+[random])/25)[/math]][founditems] [replace db=test/bids.db&eqbidderIDdatarq=[blank]&asidxsort=1&idxtype=num&max=1]bidTime=[time]&bidderID=[sku][/replace] [/founditems][/search] [/showif] [/showif] *************************************************************** Naturally I cannot use this technique with replacefounditems because I'm searching in a different db than where the records need to be replaced. But there may be another way to approach this problem. 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 don't know if this will be faster or not, but it's probably worth a try as soon as I have some free time again. 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:

WordBreak Qestion (part 2) (1998) To Do list (2003) Interface to Quickbooks (2005) Extended [ConvertChars] (1997) WebCat2 - many [carts] on one template page? (1997) select multiple (1997) Truncated Sendmail (1998) WebCat b15 Mac plug-in (1997) 2.0 Info (1997) Problems getting parameters passed into email. (1997) pull downs (1997) [WriteFile] problems (1997) What would be sweet is (2003) Cannot get subtotal to work (1997) Sami (1998) PCS Emailer's role ? (1997) search function (2005) [subtotal] and others (1997) color and size options (1997) RE: Subtotal help (1997)