--- title: "Update Your Queries: New SQL Function Names Explained" slug: "maintaining-your-queries" updated: 2026-09-23T22:23:55Z published: 2026-09-23T22:23:55Z canonical: "docs.quantivly.com/maintaining-your-queries" excludeFromExternalSearch: true --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.quantivly.com/llms.txt > Use this file to discover all available pages before exploring further. # Update Your Queries: New SQL Function Names Explained ## Purpose of this article In 2025, Quantivly introduced a unified naming convention for all SQL functions in the `metrics` namespace. This change improves clarity and makes it easier to identify data elements. However, these updates may break existing SQL queries that rely on deprecated function names. This guide will help you identify and update any affected queries so they continue to work correctly on current versions of Quantivly. For example, a query that still calls a deprecated function fails with an error like this: ```plaintext ERROR: function metrics.get_intime_metrics_by_scanner_v2(...) does not exist ``` ## Function name changes #### Why rename functions? We have decided to deprecate function names that refer to version (‘_v2’) to improve our ability to track version and improve our functions usability and maintainability. #### How to know if your query is affected Running the query will generate an error message (function “” does not exist) If you find ‘_v2’ in a query, you likely need to update it. #### How to fix it Below is a mapping of function names that are now deprecated, and how to rename them in your query. | Deprecated name | New name | | --- | --- | | get_exam_data_v2 | get_appt_exam_data | | get_intime_metrics_v2 | get_intime_metrics | | get_intime_metrics_by_patient_class_v2 | get_intime_metrics_by_patient_class | | get_intime_metrics_by_protocol_v2 | get_intime_metrics_by_protocol | | get_intime_metrics_by_scanner_v2 | get_intime_metrics_by_scanner | | get_intime_metrics_by_section_v2 | get_intime_metrics_by_section | | get_intime_metrics_by_sedation_v2 | get_intime_metrics_by_sedation | ## Column name changes In addition, the output column names of these functions were changed. #### Why rename columns? We evolved our naming convention to make query outputs easier to understand and self-explanatory. Read this [article of our SQL Tutorial](/v1/docs/in-time-metrics#demystifying-column-names) for more information. #### How to know if your query is affected You will most likely see an error that “column ” does not exist. Use this article to look up column names for which you are getting an error and edit them as indicated below. #### How to fix your query **Fixing** `get_intime_metrics` **columns** | Deprecated name | New name | | --- | --- | | marker_date | marker_date | | is_incomplete | period_is_incomplete | | time_pd_start | interval_start | | time_pd_end | interval_end | | first_examination_start | exam_start_min | | last_examination_end | exam_end_max | | first_appointment_start | appt_start_min | | last_appointment_end | appt_end_max | | | exam_accnumber_cnt | | examination_count | exam_block_cnt | | | exam_study_cnt | | | appt_accnumber_cnt | | appointment_count | appt_block_cnt | | | appt_order_cnt | | performed_table_utilization | scanner_utilization_avg | | scheduled_utilization | schedule_utilization_avg | | performed_examinations_per_hour | exam_daily_cnt_per_hour_avg | | scheduled_appointments_per_hour | appt_daily_cnt_per_hour_avg | | performed_inter_examination_gap | exam_gap_avg | | scheduled_inter_appointment_gap | appt_gap_avg | | performed_inter_examination_longest_gap | exam_gap_daily_max_avg | | scheduled_inter_appointment_longest_gap | appt_gap_daily_max_avg | | performed_examination_duration_avg | exam_duration_avg | | performed_examination_duration_median | exam_duration_median | | scheduled_appointment_duration_avg | appt_duration_avg | | scheduled_appointment_duration_median | appt_duration_median | | appointment_examination_start_delay_avg | appt_exam_start_delay_avg | | appointment_examination_start_delay_median | appt_exam_start_delay_median | | appointment_examination_end_delay_avg | appt_exam_end_overrun_avg | | appointment_examination_end_delay_median | appt_exam_end_overrun_median | | appointment_examination_delayed_count | appt_exam_delayed_cnt | | appointment_next_examination_delayed_percentage | appt_exam_delayed_pct | | | appt_exam_checkin_wait_time_avg | | appointment_examination_slot_utilization | appt_exam_slot_utilization_avg | | scanner_start_finish_interval | scanner_start_finish_interval_avg | | schedule_start_finish_interval | schedule_start_finish_interval_avg | | scanner_open_to_first_exam_delay | scanner_open_to_start_delay_avg | | scanner_last_exam_to_close_gap | scanner_close_to_end_overrun_avg | | scheduled_open_to_first_appointment_delay | schedule_open_to_start_delay_avg | | scheduled_last_appointment_to_close_gap | schedule_close_to_end_overrun_avg | | operating_time | schedule_operating_time_sum | | appointment_table_time | schedule_use_time_sum | | exam_table_time | scanner_use_time_sum | **Removed columns:** - first_room_start - last_room_end - room_utilization - appointment_room_slot_utilization **Fixing** `get_appt_exam_data` **columns** | Old name | New name | | --- | --- | | examination_id | examination_id [no change] | | appointment_id | appointment_id [no change] | | imaging_resource_id | exam_resource_id | | appointment_imaging_resource_id | appt_resource_id | | examination_start | exam_start | | examination_duration | exam_duration | | examination_end | exam_end | | | scan_start | | | scan_duration | | | scan_end | | appointment_start | appt_start | | appointment_duration | appt_duration | | appointment_end | appt_end | | calc_appointment_duration | appt_duration_overlap_adjusted_clipped | | examination_start_clipped | exam_start_clipped | | examination_duration_clipped | exam_duration_clipped | | appointment_start_clipped | appt_start_clipped | | appointment_duration_clipped | appt_duration_clipped | | combination_examination_ids | combination_exam_ids | | combination_examination_durations | combination_exam_durations | | combination_examination_durations_clipped | combination_exam_durations_clipped | | combination_appointment_ids | combination_appt_ids | | examination_gap_after | exam_gap_after | | appointment_gap_after | appt_gap_after | | appointment_room_start_delay | appt_exam_start_delay | | appointment_room_end_delay | appt_exam_end_overrun | | | appt_exam_checkin_wait_time | | slot_examination_utilization | slot_utilization | | operating_resource_id | operating_resource_id | | marker_date | operating_date | | interval_start | interval_start | | interval_end | interval_end | **Removed columns:** - room_start - room_duration - room_end - room_start_clipped - room_duration_clipped - room_gap_after - slot_room_utilization > [!NOTE] > Do you need further support with deprecated queries? > > Please contact our Customer Experience team at [contact-cx@quantivly.com](mailto:contact-cx@quantivly.com) ## Related - [Building your own SQL queries from scratch](/building-your-own-sql-queries-from-scratch.md) - [Write queries in the Quantivly Hub (Browser)](/the-quantivly-sql-engine.md)