Will try it out. To find if a table is memory optimized, please refer to - stackoverflow. You can try the other way around. It does the same thing more or less. Check the section "Insert or update? Jim Tetraneutron Tetraneutron Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Stack Gives Back Safety in numbers: crowdsourcing data on nefarious IP addresses.
Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Linked 1. See more linked questions. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 11 years, 8 months ago. Active 6 months ago. Viewed k times. Improve this question. Acorn Prashant Prashant 4, 9 9 gold badges 40 40 silver badges 56 56 bronze badges.
Add a comment. Active Oldest Votes. Improve this answer. Peter Lang Peter Lang Great suggestion. See : dev. Simon: Thank you! Updated my answer. Caution: Don't use the variable name new — harlekintiger. I don't work with MySQL though, so could you please elaborate why it should not be named new? Thank you! Improve this answer. K-Gun Regarding the "another great solution" link, I would also consider a different answer to the same question: stackoverflow.
I was wondering if you can do multiple upsert like this in one transaction, i. Sam stackoverflow. I also prefer this approach. Jacob Thomason Jacob Thomason 2, 2 2 gold badges 15 15 silver badges 20 20 bronze badges. The accepted answer works on SQLite that was my aim. You're right, I thought the OP was looking for something that was portable. Failing cleanly instead of discarding data is a feature, not a bug. Replace always removes the row first, so it is messy. Xeoncross Xeoncross If the data isn't that important, yes.
However, if this is being used on a busy site where many IPs are hitting the service, the memcached instance s might get full and cause some content to be dropped. Backing up memcached contents would also be interesting if required. ElliotFoster Memcached can handle as much data as the RAM you throw at it if you want persitance also then use redis or membase. If you are getting over 1 million visitors day then you can probably afford giving your memcache instance more than 30MB of ram which is the default I think.
However, it can certainly handle a much higher load than SQLite and MySQL for the amount of memory you give it - there just isn't any comparison.
Please do not mistake my comment as a vote against memcache, as I think it is a fantastic tool. As is redis I cannot speak for membase, as I've not used it. Yes, redis has persistence, but data is persisted to disk on an interval last I looked and memcache not at all. Like I said, if the data isn't important or can be reproduced easily then memcache and company are great.
0コメント