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:

Text data with spaces in them... (1997) For those of you not on the WebCatalog Beta... (1997) docs for WebCatalog2 (1997) .html processing? (1998) Price Change (2000) RE: Cookie Question (1999) Order not created error (1997) Seattle based Webcatters? (2000) What am I missing (1997) [searchString] (1997) Order not created error (never mind) (1997) MacFinder -- a new WebDNA web site (1998) Mac Lockup Problems (1998) Dummy Credit Card Number for debug? (1997) php vs WebCatalog (2000) WebCat2b13 Command Reference Doc error (1997) WebCat2b13MacPlugIn - [showif][search][/showif] (1997) Help! WebCat2 bug (1997) Search results templates (1996) WebCatalog Plug-in for Webstar. (1997)