Manage data sources

Once your database or data warehouse has been connected to Chartio, you can manage or move the connection and track connection or query errors directly from the Data Sources page. This section highlights how to do this along with ways to customize how your data can be queried within Chartio.

Schema

General Settings

Data Source Alias

You can rename an existing Data Source and update how it’s displayed for users in your account. To do this, select Data Sources from the top navigation bar.

![Data sources navigation](/images/uploads/Data Sources.png “Data Sources - Navigation”)

From the Data Sources page, click on the Data Source you’d like to update. Under the General tab, simply update the Data Source Alias to the new name and click “Save.”

Choose your data source from the list and click on it. In the General tab, add the new Datasource Alias and click Save to update.

![data source alias](/images/uploads/Data Source Alias-1.png “Rename Data Source Alias”)

Any charts using this Data Source will now display your new Alias. Users in your account will now also see this name for the Data Source throughout the platform.

Max Query Duration

Chartio allows you to set a Maximum Query Duration for your data source, up to 300 seconds. Any queries that take longer than the amount of time specified will be cancelled. Set this to a low value to prevent long-running queries from tying up resources on your database server and slowing down other queries.

Set the max query duration under the data source settings

Query Mode

It is possible to restrict the query mode (Interactive vs. SQL) used to query specific data sources in Chartio. The default in Chartio is that either mode is available to your editors. This default can be adjusted for each of your data sources. For existing data sources, any charts previously created in the disallowed mode will be viewable but not editable.

You can make this change on any of the data sources in your organization. You must be an Owner of your Chartio account or Admin of the data source to update the default.

From the main menu in Chartio select ‘Data Sources’ and then select the data source you would like to restrict. In the ‘General’ tab you can then adjust the ‘Query Mode’ as appropriate. Once you’ve made the change, hit ‘Save’ and you will be good to go.

![Restricting data source to Interactive Mode](/images/help/restricting-data-source-to-interactive-mode/image.png)

Time Zone Support

For detailed Time Zone information, view our time zone support documentation and how data source timezones work.

Access

Manage user access to the data source. For more details, view our data source access page.

Connection

View the data source login and host info. For more details, view add a new data source in Chartio.

Schema

You can customize the schema for your data source. For more information, view our detailed schema page.

Debug

New connections

Each database has its own set of potential connection issues. Instead of documenting them all into a large tree of potential issues, Chartio has built error reporting and advice for fixing the errors directly into the setup wizard and direct connection forms, where they’re more directly helpful to you. If these tools aren’t enough to solve your problem, please don’t hesitate to email us at support@chartio.com.

Existing connections

If you’ve lost your connection to a previously working data source, Chartio has built a nice interface to help you debug the issue. Choose Data Sources from the top navigation, select your data source from the list, and switch to the Debug tab.

Chartio will run a series of tests on the different aspects of the connection that could go wrong. If your connection is healthy, the interface should look like the following:

Demo Source debug

If something is wrong, the interface will tell you where it is wrong and provide a description of what might be happening and the steps you can take to fix it.

Query log

There are times when it may be helpful to view the actual queries that are sent to your database. Chartio allows you to view and download the query log for each connected data source.

View query log

Select Data Sources from the top navigation and choose your data source from the list. Switch to the Query Log tab.

Open the Query Log tab under the data source settings

You’ll be able to view the Start Time, Query SQL, Errors (if any), and Query Duration. Query Duration includes only the time it takes your database to run the query—it does not include chart rendering time. You can also filter by dashboard or chart in the dropdown menus if you’re troubleshooting for a particular chart. The Query column also contains links back to the chart and dashboard.

You can download the query log as a CSV, and even upload it back to Chartio to analyze your query data.

Canceling running queries

Another feature of the query log is that it allows you to monitor the duration of any queries that are currently running, and cancel them if desired.

Occasionally a database does not respond to a cancel query request from Chartio. MySQL, in particular, requires an open connection to send a cancellation request; if there is no open connection available (because many queries are running), the request will be unsuccessful.

Cancel running queries in the query log

Stats

Switch to the Stats tab in your data source’s settings to view statistics about the queries ran on your data source. An easy way to improve database performance is to take a look at the Slowest Charts and begin optimization there. You can also easily see what time of day your database processes the most queries and which charts have the most errors.

View data source usage stats

Activity

In the Activity tab, you’ll be able to see actions taken by users, from foreign keys to schema changes to permissions changes. You can also download this information for further analysis.

Activity tab