Create a cleanup report to find title records whose title dates are before the publication dates of the earliest publication record associated with the title. Allow "ignoring" titles.
Start with titles whose 4-digit year is before the earliest pub's 4-digit year. Implement the report one title type at a time to make it more manageable. Here is the breakdown of affected titles by title type as of 2019-11-16:
+--------------+--------------------+
| ANTHOLOGY | 287 |
| COLLECTION | 821 |
| COVERART | 4534 |
| INTERIORART | 22763 |
| EDITOR | 11 |
| ESSAY | 10717 |
| INTERVIEW | 455 |
| NOVEL | 6203 |
| NONFICTION | 327 |
| OMNIBUS | 171 |
| POEM | 6222 |
| REVIEW | 1896 |
| SERIAL | 73 |
| SHORTFICTION | 39750 |
| CHAPBOOK | 397 |
+--------------+--------------------+
The SQL query was:
select t1.title_ttype, count(t1.title_id) from titles t1
where YEAR(t1.title_copyright) <
(select YEAR(min(p.pub_year))
from pubs p, pub_content pc
where pc.pub_id = p.pub_id
and pc.title_id = t1.title_id)
group by t1.title_ttype;
The query logic may need to be enhanced. The current query's performance on the development server is not very good. It also locks all ISFDB title/publication pages while it runs.
Anonymous
Part 1 - COVERART titles implemented in:
Installed in SVN 482 on 2019-12-06. Keeping the FR open since Part was limited to COVERART titles. Other title types will be added once COVERART titles have been cleaned up.
Part 2 - Limited the scope to variant titles for now since parent titles have trickier date logic:
Installed in SVN 484 on 2019-12-08. Keeping the FR open.
Part 3 - Added SERIAL titles:
Installed in SVN 490 on 2019-12-28. Keeping the FR open.
Updated counts for VTs only:
select t1.title_ttype, count(t1.title_id) from titles t1
where YEAR(t1.title_copyright) <
(select YEAR(min(p.pub_year))
from pubs p, pub_content pc
where pc.pub_id = p.pub_id
and pc.title_id = t1.title_id)
and t1.title_parent > 0
group by t1.title_ttype;
Updated 2021-10-04 counts for VTs only:
Part 4 - Added anthologies, chapbooks, omnibuses and collections:
Installed in SVN 772 on 202110-05.