Understanding not and not-join

Trying to understand the use of not and not-join in queries.

Multiple not Clauses

The following raises:db.error/insufficient-binding [?release] not bound in not clause:

 (d/q '[:find (count ?artist) .
       :where [?artist :artist/name]
       (not
        [?release :release/artists ?artist]
        [?release :release/year 1970])]
     db
     "John Lennon")

I’m trying to understand why via the description in How Not Clauses Work:

One can understand not clauses as if they turn into subqueries where all of the variables and sources unified by the negation are propagated to the subquery. The results of the subquery are removed from the enclosing query via set difference.

Subqueries of what? Of the set of results returned by the query without the not clause? Would it be correct to understand that because the query without the not clause does not contain ?release, the not clause cannot refer to it?

not and not-join

The following gives 4124:

(d/q '[:find (count ?artist) .
       :where [?artist :artist/name]
       [?release :release/artists ?artist]
       (not
        [?release :release/year 1970])]
     db
     "John Lennon")

While this gives 3263:

(d/q '[:find (count ?artist) .
       :where [?artist :artist/name]
       (not-join [?artist]
                 [?release :release/artists ?artist]
                 [?release :release/year 1970])]
     db
     "John Lennon")

It seems to me the two queries are the same–where do they differ?

The key difference between your two queries is that the first not clause removes ?releases from consideration in the outer query, while the not-join clause removes ?artists from consideration.

The not clause says “remove all releases with :release/year of 1970 from consideration for the rest of the query”, while the not-join says “remove artists that are referred to by a release with :release/year of 1970” from consideration for the rest of the query.

In other words, the first query is asking for all artists except those that have releases only in 1970. The second query is asking for all artists except those that have at least one release in 1970.