Performance improvements for `/samples/{sample_id}/report_info` endpoint. (#2133)
Performance improvements for `/samples/{sample_id}/report_info` endpoint. (#2133)

Optimizations in this code change:
1) ActiveRecord `.each` method creates an instance of TaxonLineage for each row, which is resource intensive and extremely slow. That would only be useful if we needed to invoke any additional method of TaxonLineage. Since we only need the raw values, we can avoid this transformation by using `.pluck`. Pluck returns just an array of values instead of an array of TaxonLineage instances.
2) Previous code was also iterating using `.each` and adding results to a Hash one by one. These steps were optimized by chaining `.map` and `.to_h`.
3) The `.as_json` invocation on each record is much slower than zipping (`.zip`) the column names to the values returned by `.pluck`. (this performance gain is directly related to item 1).
4) Small optimization on the query used to retrieve lineage_version. This version is resolving in one query (previous was using 2).
5) Added # frozen_string_literal: true to this module to save resources
6) Removed unused fields from lineage sub-structure: `created_at`, `ended_at`, `started_at`, `updated_at`, `version_end`, `version_start`

More info: https://docs.google.com/presentation/d/1bjyjv6Heqtf_dsb20H8auqt1b1ArNpUON2aNgp7nddU/edit?usp=sharing
chanzuckerberg/idseq-web,chanzuckerberg/idseq-web,chanzuckerberg/idseq-web,chanzuckerberg/idseq-web,chanzuckerberg/idseq-web