Database looks like
$ psql checkouts <<< "\d"
List of relations
Schema | Name | Type | Owner
--------+-----------+-------+--------
public | checkouts | table | brooks
(1 row)
$ psql checkouts <<< "\d checkouts"
Table "public.checkouts"
Column | Type | Collation | Nullable | Default
------------------+---------+-----------+----------+---------
usage_class | text | | |
checkout_type | text | | |
material_type | text | | |
checkout_year | integer | | |
checkout_month | integer | | |
checkouts | integer | | |
title | text | | |
creator | text | | |
subjects | text | | |
publisher | text | | |
publication_year | text | | |
Indexes:
"year_idx" btree (checkout_year)
Data looks like
usage_class | checkout_type | material_type | checkout_year | checkout_month | checkouts | title | creator | subjects | publisher | publication_year
-------------+---------------+---------------+---------------+----------------+-----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+------------------
Physical | Horizon | VIDEODISC | 2017 | 7 | 10 | Shark tale [videorecording] / DreamWorks Animation ; DreamWorks SKG ; Pacific Data Images ; produced by Bill Damaschke, Janet Healy, Allison Lyon Segan ; screenplay, Rob Letterman, Michael J. Wilson ; directed by Bibo Bergeron, Vicky Jenson, Rob Letterman. | | Groundfishes Juvenile fiction, White shark Juvenile fiction, Tall tales, Friendship Fiction, Feature films, Animated films, Childrens films, Comedy films, Video recordings for the hearing impaired | DreamWorks Home Entertainment ; Distributed by Universal Studios Home Video, | [2005].
Physical | Horizon | BOOK | 2017 | 7 | 1 | Extreme food : what to eat when your life depends on it / Bear Grylis Bear Grylls. | Grylls, Bear | Wilderness survival, Self reliance, Outdoor cooking, Cooking Game, Hunting, Plants Edible, Trapping, Fishing | William Morrow, | 2015.
Digital | Hoopla | MUSIC | 2017 | 7 | 1 | Run River North | | Alternative | Nettwerk Records |
Digital | OverDrive | EBOOK | 2017 | 7 | 1 | On The Ball: EJ12 Girl Hero Series, Book 6 | Susannah McFarlane | Juvenile Fiction | Lemonfizz Media | 2017
Physical | Horizon | VIDEODISC | 2017 | 7 | 2 | Ghare-baire [videorecording] = The home and the world / Janus Films ; The National Film Development Corporation of India ; screenplay and direction by Satyajit Ray. | | Bengal India Drama, Government Resistance to India Drama, India History British occupation 1765 1947 Drama, Triangles Interpersonal relations Drama, Man woman relationships India Drama, Feature films, Fiction films | The Criterion Collection, | [2014?]
Physical | Horizon | BOOK | 2017 | 7 | 2 | Invasive / Chuck Wendig. | Wendig, Chuck | United States Federal Bureau of Investigation Fiction, Murder Investigation Fiction, Women detectives Fiction, Billionaires Fiction, Research teams Fiction, Genetic engineering Fiction, Science fiction | Harper Voyager, an imprint of HarperCollins Publishers, | [2016]
Physical | Horizon | BOOK | 2017 | 7 | 9 | Hooray for bread / Allan Ahlberg ; illustrated by Bruce Ingman. | Ahlberg, Allan | Bread Juvenile fiction | Candlewick Press, | 2013.
Digital | OverDrive | EBOOK | 2017 | 7 | 1 | Victory and Honor: Honor Bound Series, Book 6 | W.E.B. Griffin | Fiction, Historical Fiction, Thriller | Penguin Group (USA), Inc. | 2011
Physical | Horizon | SOUNDDISC | 2017 | 7 | 2 | Maui tears [sound recording] / Sleepy Sun. | Sleepy Sun (Musical group) | Rock music 2011 2020 | Dine Alone Records, | p2014.
Physical | Horizon | BOOK | 2017 | 7 | 3 | Junie B., first grader. Dumb bunny / Barbara Park ; illustrated by Denise Brunkus. | Park, Barbara | Jones Junie B Fictitious character Juvenile fiction, Easter egg hunts Juvenile fiction, Winning and losing Fiction, Parties Fiction, Humorous stories | Random House, | [2009], c2007.
(10 rows)
Running
query.sql
on my desktop machine took just under 15 minutes. What are some ways that I could make the query faster?Computer stats