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:

[WebDNA] Mailing list failure !!! (2019) Server Freeze (1998) Sort Order on a page search (1997) select multiple (1997) Include a big block of text (1997) ISAPI WC6a and Windows 2003 Web Edition (2006) Weighting of grouped results possible? (was: grouping fieldsquestion) (1998) WebCat2b13MacPlugIn - [showif][search][/showif] (1997) Protect (1997) [WebDNA] Timer (2008) [WebDNA] Silly question (2016) I think WebDNA-Talk died ... :( (1997) Bug or syntax error on my part? (1997) File not found error message (1998) Press Release hit the NewsWire!!! (1997) Pithy questions on webcommerce & siteedit (1997) Error: Too many nested [xxx] contexts (1997) MacAuthorize order data fields WAS:How To question... (1997) WebCat b13 CGI -shownext- (1997) WebMerchant 1.6 and SHTML (1997)