NeotomaDB / Neotoma_SQL

Repository for functions associated with Neotoma's Postgres DB
MIT License
1 stars 0 forks source link

Indexing the Database - Query variables. #7

Closed SimonGoring closed 4 years ago

SimonGoring commented 4 years ago

I ran through all the variables used in the SQL queries here and counted the number of times they were used. I removed any id variables, since they are all indexed as a matter of course:

variable n
_notes 76
_west 26
_north 22
_south 22
_ageold 20
_ageyoung 20
_familyname 20
_east 18
_initials 17
_sitename 16
_suffix 14
_depth 13
_taxonname 13
_thickness 13
_labnumber 12
_value 12
_tablename 11
_calageolder 10
_calageyounger 10
_username 10
_age 9
_site1 9
_taxagrouplist 9
_c14ageolder 8
_c14ageyounger 8
_title 8
_url 8
_agedirectdate 7
_analysisunitname 7
_rank 7
_relativeage 7
_ageboundolder 6
_ageboundyounger 6
_altitude 6
_area 6
_calage 6
_chronologyname 6
_delta13c 6
_descript 6
_eventname 6
_isdefault 6
_chroncontroltype 5
_citation 5
_contactname 5
_context 5
_elementtype 5
_handle 5
_name 5
_relativeagescale 5
_units 5
_variableelement 5
_acronym 4
_address 4
_agemodel 4
_authororder 4
_booktitle 4
_c14age 4
_citnumber 4
_city 4
_colldate 4
_colldevice 4
_collunitname 4
_columnname 4
_contlist 4
_country 4
_date 4
_dateprepared 4
_delta15n 4
_depenvt 4
_doi 4
_edition 4
_editororder 4
_email 4
_errorolder 4
_erroryounger 4
_fax 4
_fromcontributor 4
_geopolname 4
_givennames 4
_gpsaltitude 4
_gpslatitude 4
_gpslongitude 4
_infinite 4
_issue 4
_journal 4
_location 4
_materialdated 4
_numvol 4
_origlang 4
_pages 4
_percentc 4
_percentcollagen 4
_percentn 4
_phone 4
_repository 4
_sd 4
_sertitle 4
_servol 4
_slopeangle 4
_slopeaspect 4
_state 4
_taphonomictype 4
_taxagroup 4
_translatororder 4
_vol 4
_voltitle 4
_waterdepth 4
_year 4
_agetype 3
_ageyounger 3
_analunitname 3
_author 3
_coords 3
_datasetname 3
_depagent 3
_element 3
_extinct 3
_facies 3
_fraction 3
_gpserror 3
_issamp 3
_maturity 3
_nisp 3
_nparam 3
_portion 3
_reservoir 3
_schema 3
_symmetry 3
_synonymtype 3
_table 3
_taphonomicsystem 3
_taxanames 3
_taxon 3
_taxoncode 3
SimonGoring commented 4 years ago

I've added a few indexes. Hopefully this should reduce some time issues with the ti GET requests.