How is this graph drawn?

Hi everyone,
This graph, drawn in the History Dashboard, shows a “dynamic” view that seems to suggest that samples are taken very regularly (seconds).

image

However, if I try and drill-down to the source of that sensor, I get a little confused!
As I understand the sensor, it passes through the MQTT server. If I watch that data arriving (using the Add-On MQTT Explorer), it seems to be arriving every 10sec.
However, if I look to the database, I only see records every hour?
I am no SQL programmer but this is my query:

select DATETIME(created_ts, 'auto'), state from statistics
where metadata_id = (select id from statistics_meta where statistic_id = 'sensor.smart_meter_electricity_power') 
order by DATETIME(created_ts, 'auto') DESC

So, my question is this: If the database only contains hourly sample, how is the history graph being drawn with sub-minute intervals? And…

How can I get an csv file with those sub-minute samples?

Regards, Martin