55
stefant
7y

SELECT * FROM programmers WHERE attr='no_gf'

Query took 6 months.

Comments
  • 11
    Could speed that up if you weren’t returning all the unnessasary data.

    SELECT COUNT(id)
    FROM programmers
    WHERE attr = “no_gf”
    GROUP BY attr;

    I don’t need to know who they are.

    @NoMad
    They don’t get returned?
  • 2
    I have one lol.
  • 1
    Wonder what’s the query plan...
  • 0
    Depends on what the OP was intending the search to do

    For single we could just use another field for relation status enum(single, partner, married, other)
    And look at that instead

    Unless the Op wants to know how many don’t have a GF, then this would also include Female and Male relationships as it stands.
  • 4
    Similar to @NoMad, I have a wife and no gf. One is plenty.
  • 1
    @C0D4
    You must be in row #1
  • 2
    @stefant
    I’m not in this result set 😎
  • 1
    For me this query means select every programmer with no girlfriend.
    Why should this take 6 months ?
  • 2
    Negative naming on entity properties,... Smh
  • 1
    Depending on the fb engine it would be faster to have a bool field of 'partner_status' rather than trying to do a string match
  • 5
    I literally do not know a single programmer who is single.

    There are 23 devs at work, all married or with girlfriend, one gay and 3 females with boyfriend. And they're not at the bottom of the gene pool either, at company parties they all seem smart and good looking.

    Meanwhile, many of the guys from sales are single, or have one-week relationships.

    Devs are the new alphas 🤘
  • 1
    That query includes most women.
  • 0
    There was a wonderful essay at https://qntm.org/gay that outlined modern relationship issues with databases. But the bloke took it down for a rewrite so I will leave it to you to find an archived version.
  • 0
    Well how long would the query take if you used “attr=‘partner’”? That statement on its own doesn’t hold much value.
  • 0
    @bittersweet 🤘
    👌
Add Comment