Sargable and Non-Sargable Desires
There’s a particular aroma, fruitiness in the names that computer scientists give their problems: parameter sniffing, leaky abstractions, busy beaver functions. And since computers face problems that many humans do—searching things, organizing things, planning things—I find these colorful terms to be close analogues to problems I experience not as a developer, but as a human being. I would love to ferry as many of these words as possible into everyday speech so as to clarify things I feel with cherry garcia diction.
This is why you don’t know what the word sargable means. It’s a technical term in database design and query writing that defines how efficiently we can search for certain things. In short, I would describe a sargable search as one where you know when to quit, when you know when you’ve found everything that you’re looking for. A non-sargable search, in contrast, is one where it is hard to know when you’ve found everything you’re looking for, and where it’s often necessary to look over the whole corpus of data to verify you truly have what you need.
Purchasing, buying things, it’s all about effectively searching out and sating our needs. But there are desires, I think, that are sargable and some which are not; some needs are, when satisfied, clearly sated, but there are other needs where we don’t ever know really if we’ve been satisfied—how do we know when we’ve been productive enough for a day, when we have met the right person, when we have bought the laptop that actualizes all of our computational needs. And it is these non-sargable desires that I think are the most pernicious, and lead us astray.
Sargability on the Database
I want to go into more detail about sargability in its formal sense, and then talk about how I think of it in terms of purchases and desires. I will use a non-technical database to illustrate, that is, a library whose books are ordered in alphabetical order by last name.
A sargable query is if I were to ask you to find all books in my library by “Lispector, Clarice.” You would go to the bookshelf and you would seek out the L section, the Li section, and so on until you have found the books by Lispector. What makes this query sargable is that you know the second you reach “Liu, Cixin,” then you can stop your search. The books are in order alphabetically. The ordinal rank of “Liu, Cixin” when it comes to the alphabet is higher than that of “Lispector, Clarice.” Therefore, you can call it quits. The need is satisfied. No amount of searching is needed beyond this point.
A non-sargable query would be if I asked you about the literary Jonathans. I would like you to find every author in my library with the first name Jonathan. While it seems like a similar query at first—what is in a name?—since I have not sorted my bookshelf by first names, but only by last names, you will have to check every single book. No matter how many books you pick up, you won’t know if you’ve found all of them until you have reached the end of the stacks.
(For those with SQL experience, this is why the “=” operator is sargable whereas the “like” operator is not.)
This matters for a lot of blah-blah-blah reasons related to query performance, and a lot of a BID’s work on a given day involves trying to rewrite queries so that they are sargable. For example, in the previous query, if I had a list offhand of every Jonathan in my library, you could behave more efficiently by popping into the L section for Lethem and into the U section for Updike, and calling it quits early. Therefore, sargability is a feature that emerges from the union of the way we ask queries, and the structure of the database itself. If we had sorted by first name, our Jonathans query would be sargable. If we already knew the Jonathans we actually cared about, and had a hand-written list with the Jonathans we desired, sargability is ours! Therefore, a query itself is not sargable, but a query as run on a specific database is.
Sargable Desires
I like the word sargable mostly because I like beautiful words, and sargable sounds perfectly cromulent, and has a great mouth feel.
But I think about searching all of the time because life involves a lot of looking.
When I first heard of sargability, I imagined a library like the one above, and then my mind wandered to an article I had read as a teenager about the psychogeography of department stores. This article answered why your local Target changes the location of everything every year or so. They do this to intentionally frustrate. The idea is to destroy your mental map of the store, thereby forcing you to, on your next visit, wander every aisle until you find your desired products. In a way, your shopping experience on the day-to-day is incredibly sargable—you never have to check all of the aisles because you know where the dairy is, where the tofu is, and can quit when you have found the last item on your list. These stores change everything up intentionally to disrupt this sargability.
It’s not a direct analogue—when you have finished your shopping list, you are done shopping, and rarely would you behave like a database query and seek to “purchase all things that are cheese and have an expiration date less than a week away.” Just having a list makes the experience more sargable. But stores know that there is a lot of value in forcing you to look at everything, because, again, unlike a database query, sometimes you decide to pick up things not specified in the initial query just for fun. (There’s some Manchego cheese in this aisle? Well, now that it’s in front of me…)
As mentioned above, sargability is an emergent feature. To reap the benefits of sargability, the query writer and the database must work together. But stores and consumers are not on the same side; they’re only sometimes in a convenient alliance. In the case above, the database—our Target store—has decided to be antagonistic in order to get you to buy things you don’t need. Sargable desires then are not an inherent quality of desires, but an aspect of desires as they are situated within this specific world where our desires can be fulfilled.
Since query specification also matters to sargability, let’s turn to desires and the hallmark of sargable ones.
There are desires which are sated and we know it immediately. In the morning, we wake up and pee, we wash our face. We never have to ask ourselves when it’s okay to stop peeing. We know, at a certain point, when to call it quits. We know when we are full (within reason), and we mostly know when we are hydrated. There are certainly edge cases and complications to these facts, but in general, I think most people can tell you when their most basic needs are met.
But just with our library, seemingly similar desires can have quite different levels of sargability. Going to the store with a strict shopping list yields sargable results. But going to the store without a good sense of what you want, or merely to browse, or simply writing “something yummy” as the third item of your list means that you will need to search every aisle (or most every aisle) before you know if you’ve found what you were looking for. I have wandered grocery stores trying to find the perfect comestible for me. But I also know that this puts me at risk of buying stupid stuff.
For a slight twist on this idea, I think sargability is one reason that pre-planning meals is an activity frugality bloggers hold in such high esteem. The question of “what would be a good dinner” is not a sargable query. In this example, there are so many options, and these options are not indexed to your cravings—maybe tonight a need for peanut butter, maybe yesterday for oil—and as such there is no way you can say for certain while shopping for dinner that you have found the right thing. Having a pre-planned meal regiment, on the other hand, changes the question of shopping for dinner, from the question of “what would be good for dinner” into “how do I find the items on my list,” a request whose satisfaction is easy to determine.
Non-Sargable Desires
Other desires are not so clearly sargable. Here’s an example of one: let’s say you want to buy a new laptop.
Just as in writing a query, there are some specifications you can apply to this which are sargable. If you work in a creative field, there’s a good chance you will need to purchase a Mac. If you want to play video games, a Mac is out of the question, and you will need to find something that runs Windows. Now, you don’t need to look at all of the laptops on earth any longer.
But outside the most basic of specifications, I think most of this desire is strictly non-sargable.
You may, at first, think that the screen size would be a specification you could use to restrict the query. But, this is a specification I think you’d be apt to reconsider later—external monitors are cheap, and so if you think that enough percent of your time with the machine will be spent at home, then screen size is not exactly an issue, but maybe it is an issue still. I don’t think that, when searching for a laptop, you’d be able to fix that aspect of the desire in your mind and truly quit when you’ve looked at everything with the right screen size. The fact that desires can change during the search itself is major trouble for sargability—if I said get me all of the Lispector, and maybe something by Salman Rushdie, then you can’t really call it quits when you have scoured Lispector.
Then, there are qualities that cannot be expressed numerically, or even verbalized. I am a writer, and so I need to make sure that I have a laptop with a keyboard that feels great, especially since I like writing on the go and hate bringing an external keyboard with me. When it comes to keyboards, well, there’s an example where I would need to physically check out every laptop before calling it quits. When I go to Fry’s to get a new laptop, 90% of the time is me typing Ipsem Lorums into the machines to see if they feel right. Certainly, I can sargably constrain the list of laptops I pound the keys on, but since there is no list of machines in terms of keyboard feel, I need to see them all to be sure. Furthermore, even if I do type on all of them, these are ephemeral feelings that cannot be concretized in words, and I doubt I have ever typed on a keyboard and said to myself that truly this is the one. I can’t actually know when my keyboard desire has been satisfied.
Other non-sargables arise: The cool factor of a laptop’s design can’t be searched on or indexed. Budget may at first seem like a sargable constraint, but then again, you could decide to splurge on such a large purchase, so the budget is really up to $1,500 dollars or more. Can it run Crysis? (Yes, but it could always run Crysis a bit better).
I think this last point, actually, best exemplifies desires that are truly non-sargable. “Can it run Crysis?” is a meme about computational horsepower. Crysis is a game that requires a high-end machine to run, so certainly it at first looks like a sargable benchmark. Laptop specifications are a set of numbers, and numbers look sargable at first. But, it’s actually a constraint whose goalposts are apt to move: Can it run Crysis on the recommended settings? Can it run it on the max settings? Can it run it on the minimum settings?
And this mutating desire I think is why non-sargability skewers us. Some constraints can make a decent baseline, but desires can only be partially mapped to the world of logic and constraints. When you find a machine that says it can run Crysis, your heart is going to ask itself—well, but couldn’t it run Crysis a little bit better? Then, you can specify that you only want machines that run Crysis superbly, but when you look at the price tag of those machines, you may start to ask yourself—well, couldn’t it run Crysis just a little bit less?
The thing is, most desires, save for the bottom of Maslow’s hierarchy, are not sargable. And note, I have said desire, not purchase. Even if you buy your machine that runs Crysis as God intended, I bet that when it arrives you won’t know, really, if it scratched your itch optimally. That’s, in part, Nir Eyal’s point on how we have a comparison mode and an experience mode. After all, the machine is here before you, Crysis in all its visual glory, but maybe you could have had something more.
Or, maybe, you end up never downloading Crysis, and just use it to write your blog. Did the desire get satisfied if, in your heart-of-hearts, you never had the desire at all?
Laptops are one problem, but the big questions in life are defined by non-sargable desires. You will never know when you’ve made it in your career, in your relationships, when you can stop looking for more money. Mark Manson describes it well in his article The Disease of More. But when things as simple as not being bored, or buying a laptop, involve not really knowing if you’ve sated your needs, the big questions are going to be light years worse.
Well, What is to Be Done?
I can’t offer solutions, just pretty words. But, if I were in the solution offering business, this is what I’d propose.
Sargabilize as much as possible: Remember, it is the type of desire, or the way the desire is phrased, that makes something sargable. The meal prep example shows this off well—If you replace the deeply non-sargable question of “What do I need to buy to be happy?” with “How do I acquire steel cut oats, lentils, and broccoli florets” I think your life will be easier. This has been true for me. I really only eat grains and vegetables that I can put in a rice cooker, and by removing the uncertainty and difficulty of hunting for dinner, I think my life has improved. Sargabilize those things you can, small things in particular.
Stop making decisions entirely: This idea is rather widespread in the lifehacking world, and these various links (citing everyone from President Obama to choreographers to Tim Ferriss to fans of the KonMari method) show the value of reducing decision-making altogether. You can’t waste time searching if you never start the search.
Get better at being okay with uncertainty: Here’s the difference between us and a DBMS—when I tell SQL Server to give me all of the books by a literary Jonathan, if it doesn’t get back to me with all of the right rows of data in a timely fashion, I uninstall it and move to Oracle. A database needs 100% accuracy. That’s why sargability is so important to it. But fundamentally, you and I, we’re fine if we buy a computer that can’t run Crysis, or a backpack when we really should have bought a messenger bag, or a flashlight with only 10 meters of depth resistance. We’ll never know if we’d be happier if we sated our laptop desire with a gaming laptop with incomparable specs. But unlike SQL Server, it really doesn’t matter most times if we get bad results for our queries. It’s hard to accept that we don’t need to maximize our happiness, but even if we did reach maximum joy I doubt we’d even know it. We hardly know if we’ve made ourselves a great dinner.
That’s all. I am sorry for linking three xkcd comics in this article. If you want a smarter person who can synthesize computer science notions with human experiences, check out David Maciver or David Chapman.