On not being miserable

I stumbled across "I am rich and have no idea what to do with my life" on the orange website today. I found it both frustrating and funny, because I feel that this represents a common error in thinking modern western culture. That is: the idea that happiness can be found in achieving some identity.

In the article, I paraphrase that the author has aspirational goals like:

  • I want to be rich enough that I never have to work again.

  • I want to climb the tallest mountains.

  • I want to change the world.

These aspirational status-seeking goals are a trap; A cursed form of hedonism that takes lots of effort for only a little pleasure in return. Unfortunately, whilst achieving ones goals does indeed feel good, the feeling is unsustainable. The source of these desires is the desire to be a certain kind of person, that has achieved some high-status identity with the mistaken belief that achieving this identity will make them happy.

The idea that happiness and contentedness can be found in success and status, is in my observation, somewhat untrue. Before we can understand why this is the case, we need to first understand a few things about identity. For example, what an identity is actually for.

What is a personal identity?

Before we can get to the rarely spoken of reflection on the utility of an identity, it makes sense to first define what it is.

Personal identity is a name, or descriptor that we have for ourselves. It takes the form, "I am ____", where blank could be "a programmer", "Gregokavich", "a human", or any words that we might use to describe ourselves. A personal identity also consists of things like, "I like pie", and "I dislike smelly feet". It doesn't matter how long or complex or nuanced it is, so long as we believe it to be true.

Most of the world goes through life with the belief that a person and their identity are one and the same thing. That as we grow older and more mature, we learn more and more about ourselves and develop a more and more nuanced understanding of our identities.

I was certainly surprised in my adulthood to discover that this is not the case. Only sometimes do we discover our identity by observing our own behaviours, instead our behaviour is dictated by our identity.

For example, a person that identifies as ethical, when presented with an opportunity to steal without getting caught, will make the decision not to steal. A person that identifies as a member of a sports team, will make sure that they get to all of their games. A person identifying as a man will hopefully prefer to go to the men's toilet rather than the women's.

So then:

What is identity for?

The primary purpose of an identity is to help you and others make decisions about you more quickly and easily. It is a form of optimisation. This optimisation applies in multiple ways:

  1. The identity you present to others helps them decide how to treat you.

  2. Your personal identity guides your choices of how to behave.

We need this, because otherwise when we face a decision, like, "what should I have for breakfast?", we would be paralyzed with indecision unless we have already have a sense of personal identity in regards to this. (I enjoy avocado on toast.)

This feeling of indecision and uncomfortable moratorium is a universal human feeling where we are facing choices for things that we do not have a strong sense of personal identity. "Now that I'm rich, what should I do with my life?", or, "What should I study at university?". For some of us, this decision is easy and for many others of us it is completely paralyzing.

So therefore, a well-formed identity is useful to avoid suffering. It makes decisions lower-effort and less painful. But it is in my opinion important to keep in mind that reduced suffering and happiness are not the same thing.

Having a complex achieved identity will not cause you to be happy, unless somehow that achieved identity is, "I am happy".

So here we stumble across some more nuance: We have both achieved, and aspirational identities. We have the identity that is the sock-puppet we hold up in-front of ourselves for other people to see, which is distinct from the identity we want to have, which can also be distinct from how we actually behave. This sock-puppet is sometimes called the "ego" or "egoic identity".

The important thing about this complexity, is whilst an identity can help relieve suffering, it can also cause it.

For example, a person that identifies as a Christian will desire to follow the rules taught to them by their church (aspirational identity), will want their community to see them as a Christian (egoic identity), but then they might have have anti-Christian prejudices that they keep to themselves that are in conflict with both of these.

This person will suffer from cognitive dissonance whilst they try to resolve the the conflict between their prejudices in their identity ("I don't like ___ people") and their Christian ideals ("love your neighbour").

Another example, is that an identity can cause us to make choices that directly lead to our own suffering. A person experimenting with a rebellious identity may try drugs, or crime. A person may throw themselves onto a grenade because they identify as good and believe that saving others is the right thing to do.

From these examples, we see that an identity is a trade-off. We ideally want an identity that is broad or nuanced enough so that we can make decisions easily, but also consistent and free of conflict so-as to avoid cognitive dissonance. Further complicating this, we also need an identity that ingratiates us to our community and gives us a sense of connection and belonging.

But, as I have already said, whilst achieving some desired identity can give us a little pleasure, it is unsustainable. We can think to ourselves, "Yes! I solved the problem like the good programmer that I am!", but feeding our ego's like this doesn't work unless we can keep adding more and more wins to feed it more and more. It is a very risky strategy of well-being because eventually we will come across a problem that we cannot solve, and then crash into an identity crises. "I failed to solve the problem. Am I really a good programmer after all?"

On not being miserable

So how do I think this ties into not being miserable? Happiness does not actually come from achieving status, climbing a mountain, being rich or accruing whatever other power we think might be useful to have in some idealistic version of ourselves. Setting goals and achieving them feels good because it feeds our ego's but it is not sufficient.

Actual happiness comes from being able to sit in a quiet room by yourself without punishing yourself. Simply choosing to be in the moment and enjoy the sensation of being alive, and then seeing that anything on top of that is just a nice bonus.

When I was much younger, I was inspired by the Paul Graham essay Keep Your Identity Small. Having a more nuanced understanding of what identity is, I think this still applies. We should see identity for what it really is: a tool. Our identity is not us, it simply a model for making decisions.

In the same way that the pursuit of truth does not lead to happiness, because truth is simply having models that make more effective predictions, the pursuit of identity is also a trap. Instead, just choose an identity that you feel will serve you and the people that you love and want to be in a community with.

I choose to think of myself as a programmer because I have invested enough time into programming to be ok at it, it gives me a community of interesting people, it allows me to make a nice living for myself and my family, and solving problems feels good.

If I was in the position where I didn't have professional skills or relationships that nurtured me already, I would study an occupation (any problem-solving one would do. Maybe I would be an electrician?) that would eventually lead to these things. Looking around for people that seem happy and then doing what they do seems like a good starting point.

5 Things I Never Wanted To Know About SQL Server

I've never loved SQL Server, but it is unfortunately the database that I have the most familiarity with. So here are things I learned about it that I didn't know before starting to use it.

1. Adding new columns can be a meta-data only operation.

In some databases, adding a column requires rebuilding the entire table. This means that adding a column to a table with millions of records could take minutes or hours. However, in SQL server, adding a column with a default value (such as nullable columns) will store the default in the tables meta-data, meaning that adding the column is almost instantaneous.

2. The ghost record "problem".

When SQL Server deletes a record, it doesn't actually delete it. Instead, as an optimisation, it marks the record as a "ghost" record to be cleaned up automatically by a later process. This process is called the ghost cleanup process. Unfortunately, this has a big downside, in that queries need to skip over ghost records, which when there are massive numbers of ghost records, this will slow those queries down.

Unfortunately, SQL Server does not provide any means to effectively fine-tune the ghost record cleanup, and certain things, such as long running queries, can cause it to be delayed for a long time.

A weird trick: In the case that the table is very small, (due to frequently adding/deleting records for example if the table is being used as an ad-hoc queue), this may be worked around by rebuilding the table which effectively flushes all ghost records.

3. Column order in indexes matters.

Something that I ought to have learned but never learned at University, is that the column order of indexes matters. This is because an index is a tree, and each additional column adds more fidelity to the sort order.

The way this can come in handy, is that if a table with two columns, named columna and columnb is queried with queries that always contain columna but sometimes also contain columnb, a single index will be sufficient to cover both of these cases, however, if columna and columnb are used independently, it will be necessary to have at least two indexes to cover these usages.

4. Creating new indexes can re-use old indexes.

Sql Server can be clever sometimes, and if you create a filtered index that is a subset of an existing index, it can use that index to build the new index without doing a table scan.

For example if you have an index like:

create index index1 on table1 (column1, column2)

And then you create a new filtered index like:

create index index2 on table1 (column1) where column1 = 'foo'

Because of the shared dependency on column1, the existing index1 will be used to build index2. This avoids a table scan.

5. Weird strategies for updating many records in a giant table.

Updating very large tables in SQL Server often cannot be done within a single transaction, because the transaction will run out of memory before it can be committed.

To get around this, we want to update tables with multiple statements.

Let's say, for example, we wish to set every instance of column1 from table1 where the value is "foo" to "bar", the naive approach would be to run something like:

update top 10000 table1
set column1 = 'bar'
where column1 = 'foo'

The first time we run this statement, it executes relatively quickly. But as we run it subsequent times it gets slower and slower. This is because on subsequent runs, it will have to scan over all of the previously scanned rows. We seem to be caught between a rock and a hard place though: If we try to update it all at once, the query hangs, but if we try to run it repeatedly, we suffer from an O(n^2) slowdown.

There is a solution! One solution is to create an index that covers the records we wish to transform. For example create index index1 on table (column1) where column1 = 'foo', but!

  1. This can run into the problem where the creation of the index takes too long and it times out.

  2. Even when the index is created the queries still are slower and slower? Why is that? It could be because of the ghost record problem mentioned above.

So what can we do? We can use a column with a unique index as a watermark to update sections of the table.

e.g. We can repeatedly run a query like, incrementing @start and @end parameters by batches of 10000 as we go along.

update table1
set column1 = 'bar'
where column1 = 'foo'
and sequence_column between @start and @end

This is also possible to do on unique indexes for uniqueidentifier columns.

On Feminism

I've recently read Feminism Is for Everybody: Passionate Politics and also am slowly grinding through Invisible Women, another piece of feminist literature.

It could be said that I am on a bit of a feminism binge at the moment. This is largely in reaction to my youtube shorts feed, which unfortunately for a while became full of anti-women propaganda, and toxic-masculinity garbage.

So what have I learned? Firstly, I have learned that I am a feminist, and secondly, I have learned that feminism as a movement is in trouble. Whoa! A straight white male providing a negative opinion on feminism! But before you cancel me forever, first let me explain.

The radical feminism defined by Bell Hooks defines a feminist as something like, "Those that that are opposed to sexism and the patriarchy", and defines patriarchy as, "a society in which the strong rule the weak".

I hold this system of values very strongly. I strongly believe that society should be dominated by democratic decision making, rather than by the private interests of the wealthy and powerful. I wholly wish that I could live in a place that embodied these values. "Feminism is For Everybody" truly panders to those that value equality of opportunity across race, class and gender, and describes a wonderful value system that ought to be easily accessible to both men and women. What is problematic though, is that this definition of feminism isn't really mere feminism.

The problem that feminism has, is that there is a much more popular definition that describes a feminist as somebody that wants equality between men and women, and this definition really has nothing to do with the inequality between women and other women of different classes and races.

This turns feminism into a pissing match, of men-vs-women where there are examples of both men and women that go around putting down the opposite gender, in a kind of fascicle competition to determine which group is superior. This is terrible two-fold:

Firstly, this kind of identity-politics is nonsense. There are so many people that do not fit into the stereotypes of their groups that it makes little sense to evaluate a person on anything other than a case-by-case basis.

Secondly, and more importantly this conflict prevents unity in facing the more important crises in our modern era: The growing wealth and power inequality.

We are living in a generation that is unable to organise itself for it's own benefit, and the conflict that is manufactured around the feminist cause by people praying on members of their own gender for support is, in my opinion, a driving factor behind this.

Find more posts in the Archive