I'm not sure how one might think patents on methods of optimizing database queries would not qualify as software patents. As someone else said below, it's applied mathematics. Heck, the "relational" part of "relational database" comes from the theory of set relations. And if databases are your field, you know that. And if you'd donated the patents to the EFF, then you wouldn't be asking this question.
Trying to play devil's advocate the only counterargument I can come up with is, "the optimizations are useful because of the way this particular computer is architected." But that's silly; much of number theory is useful and studied because it's applicable to cryptography. Being useful in an engineering situation doesn't turn mathematics into engineering.
I don't believe in telling people to fuck off for asking an honest question. At the same time, I'm not personally inclined to help you with your problem, because you're asking with help engaging in an antisocial activity. The weird thing is, from your comment, it seems we're in agreement on that, but you don't see that what you're doing is what we both believe is wrong. Dude, those kinds of patents are the types of things most software developers talk about when they mean software patents. Amazon one-click and Microsoft's FAT patent are just talked about more because *EVERYONE* runs into those, whereas only compiler developers run into the asinine register allocation patents, and only database developers run into yours. But they're still bad, just bad in a narrower field. Look up the history of register allocation in GCC and LLVM if you want to see what patents can do to OSS. LLVM uses linear scan register allocation, which is faster than the standard graph coloring algorithm, but worse-performing. Guess which consideration is most important in 2014 when you can compile on 16 CPUs at once? GCC, as usual, does something totally fucked up because it's been around so long accumulating cruft, but its algorithm was originally designed around exactly the same patents LLVM had to design around.
Again: software patents have crippled open source compilers' register allocation algorithms from the dawn of GCC to the rise of LLVM. How disgusting is that? And the register allocation patents are what happens when we're aware of the patents and they're held by an OSS-friendly company (IBM).
If you're not going to stop patenting software, but you care about the ethical implications of your work, my minimal request to you would be to donate the patents somewhere like the EFF or FSF in your will. If you don't, your heirs might decide to sell your work to SCOracle and you'll fuck up every OSS database for a LONG. TIME. I'm sure you don't want that to be your legacy.
And btw, if you haven't, you should have your estate planning done anyway. Everyone with even a small amount of assets should. Shit happens, it's not as expensive as you might think, and a competent attorney will also prepare "collaterals" where you say, among other things, what you want to happen if you end up like Terri Schiavo. And if you're not aware of why you really need to make that absolutely clear in a totally legally binding way ... just look at the Wikipedia article for "Terri Schiavo".