↓ Skip to main content

Google Search Console SQLite Schema Reference #

The Search Analytics database is created and maintained automatically by scripts/search_analytics.py. Database tables, indexes, and analytical views are provisioned during sync operations.


1. Relational Tables #

daily_site_performance #

Stores unfiltered property-level daily totals (dimensions: ['date']) without anonymized query filtering. Matches 100% of property clicks and impressions in the Search Console web interface and Achievement badges.

ColumnTypeConstraintsDescription
idINTEGERPRIMARY KEY AUTOINCREMENTUnique record ID
site_urlTEXTNOT NULLSearch Console property URL
dateTEXTNOT NULLDate of search activity (YYYY-MM-DD)
search_typeTEXTNOT NULL, DEFAULT ‘web’Search channel (web, image, video, news)
clicksREALNOT NULL, DEFAULT 0Total unfiltered property clicks
impressionsREALNOT NULL, DEFAULT 0Total unfiltered property impressions
ctrREALNOT NULL, DEFAULT 0Property click-through rate (clicks / impressions)
positionREALNOT NULL, DEFAULT 0Average property ranking position
raw_jsonTEXTNOT NULLComplete raw API row JSON payload
synced_atTEXTNOT NULLLocal sync timestamp

Unique Constraint: (site_url, date, search_type)


search_performance #

Stores daily granular search performance partitioned by query, page, country, and device.

ColumnTypeConstraintsDescription
idINTEGERPRIMARY KEY AUTOINCREMENTUnique record ID
site_urlTEXTNOT NULLSearch Console property URL
dateTEXTNOT NULLDate of search activity (YYYY-MM-DD)
queryTEXTNOT NULL, DEFAULT ''Search query keyword
pageTEXTNOT NULL, DEFAULT ''Full URL of the landing page shown in SERP
countryTEXTNOT NULL, DEFAULT ''Three-letter ISO country code (usa, gbr, jpn, bra)
deviceTEXTNOT NULL, DEFAULT ''Device category (DESKTOP, MOBILE, TABLET)
search_appearanceTEXTNOT NULL, DEFAULT ''Rich result type if applicable
search_typeTEXTNOT NULL, DEFAULT ‘web’Search channel (web, image, video, news)
clicksREALNOT NULL, DEFAULT 0Total clicks generated
impressionsREALNOT NULL, DEFAULT 0Total impressions displayed in SERP
ctrREALNOT NULL, DEFAULT 0Click-through rate (fraction: clicks / impressions)
positionREALNOT NULL, DEFAULT 0Average ranking position (1-indexed, e.g. 1.0 = top)
raw_jsonTEXTNOT NULLComplete raw API row JSON payload
synced_atTEXTNOT NULLLocal sync timestamp

Unique Constraint: (site_url, date, query, page, country, device, search_appearance, search_type)

ℹ️ NOTE

Keyword-Level Privacy Truncation: When data is queried with query in dimensions, the Search Console API omits rare long-tail “anonymized queries” to protect searcher privacy. Granular keyword rows in search_performance represent the non-anonymized query subset, while true property-level totals are preserved in daily_site_performance. The v_daily_summary analytical view automatically leverages daily_site_performance to guarantee zero data loss.


properties #

Stores verified Search Console property URLs and access permissions.

ColumnTypeConstraintsDescription
site_urlTEXTPRIMARY KEYProperty URL (e.g. https://example.com/ or sc-domain:example.com)
permission_levelTEXTAccess tier (siteOwner, siteFullUser, siteRestrictedUser)
raw_jsonTEXTNOT NULLComplete raw JSON payload from Search Console API
synced_atTEXTNOT NULLLocal sync timestamp

sitemaps #

Stores XML sitemaps submitted to Search Console, processing status, and indexing numbers.

ColumnTypeConstraintsDescription
site_urlTEXTPRIMARY KEY (site_url, path), FK -> properties(site_url)Parent property URL
pathTEXTPRIMARY KEY (site_url, path)Full sitemap URL
typeTEXTSitemap type (sitemap, feedIndex)
last_downloadedTEXTTimestamp when Googlebot last downloaded the XML
last_submittedTEXTTimestamp when sitemap was submitted
errorsINTEGERDEFAULT 0Number of parsing errors reported
warningsINTEGERDEFAULT 0Number of non-fatal warnings reported
indexed_countINTEGERTotal count of indexed URLs from this sitemap
raw_jsonTEXTNOT NULLComplete raw API payload
synced_atTEXTNOT NULLLocal sync timestamp

site_milestones #

Tracks release milestones, major publications, and architectural launches for cohort impact analysis.

ColumnTypeConstraintsDescription
commit_hashTEXTPRIMARY KEYGit commit hash or milestone unique identifier
event_dateDATENOT NULLMilestone date (YYYY-MM-DD)
titleTEXTNOT NULLShort title of the milestone
descriptionTEXTDetailed context or release notes
categoryTEXTCategory (release, article, campaign, major_feature)
scopeTEXTScope tag (site, blog, oss)
authorTEXTAuthor name or handle
created_atTIMESTAMPDEFAULT CURRENT_TIMESTAMPRecord creation timestamp

sync_history #

Audit log recording every backfill and incremental sync operation.

ColumnTypeConstraintsDescription
idINTEGERPRIMARY KEY AUTOINCREMENTUnique sync run ID
site_urlTEXTSearch Console property URL
sync_typeTEXTNOT NULLSync type (incremental, full, range)
start_dateTEXTStarting date of sync window
end_dateTEXTEnding date of sync window
rows_syncedINTEGERDEFAULT 0Total rows inserted or updated
statusTEXTNOT NULLStatus (success, failed, running)
error_messageTEXTError details if failed
started_atTEXTNOT NULLStart timestamp
completed_atTEXTCompletion timestamp

2. Analytical SQL Views #

v_search_performance #

Granular performance with computed calendar dimensions (year_month, day_of_week, ctr_pct, avg_position).

ColumnTypeDescription
site_urlTEXTProperty URL
dateTEXTActivity date (YYYY-MM-DD)
year_monthTEXTFormatted year and month (YYYY-MM)
day_of_weekTEXTFull day name (Monday, Tuesday, etc.)
queryTEXTSearch query term
pageTEXTLanding page URL
countryTEXTThree-letter country code
deviceTEXTDevice category (DESKTOP, MOBILE, TABLET)
search_typeTEXTSearch type (web, image, video)
clicksREALTotal clicks
impressionsREALTotal impressions
ctr_pctREALClick-through rate percentage (clicks / impressions * 100)
avg_positionREALAverage ranking position

v_daily_summary #

Daily aggregated search totals across all queries and landing pages.

ColumnTypeDescription
site_urlTEXTProperty URL
dateTEXTActivity date (YYYY-MM-DD)
year_monthTEXTFormatted year and month (YYYY-MM)
day_of_weekTEXTFull day name
distinct_queriesINTEGERCount of distinct search keywords
distinct_pagesINTEGERCount of distinct landing pages
total_clicksREALSum of clicks for the day
total_impressionsREALSum of impressions for the day
avg_ctr_pctREALOverall click-through rate percentage
avg_positionREALAverage ranking position

v_top_queries #

Search queries aggregated by active days, total clicks, impressions, CTR, and average position.

ColumnTypeDescription
site_urlTEXTProperty URL
queryTEXTSearch query term
active_daysINTEGERNumber of distinct days query generated impressions
total_clicksREALTotal clicks received
total_impressionsREALTotal impressions displayed
avg_ctr_pctREALAverage click-through rate percentage
avg_positionREALAverage ranking position

v_top_pages #

Landing pages aggregated by distinct ranking queries, clicks, impressions, CTR, and average position.

ColumnTypeDescription
site_urlTEXTProperty URL
pageTEXTLanding page URL
ranking_queriesINTEGERNumber of unique queries ranking for this page
active_daysINTEGERNumber of active traffic days
total_clicksREALTotal clicks received
total_impressionsREALTotal impressions displayed
avg_ctr_pctREALAverage click-through rate percentage
avg_positionREALAverage ranking position

v_country_breakdown #

Geographic search performance aggregated by country code.

ColumnTypeDescription
site_urlTEXTProperty URL
countryTEXTThree-letter ISO country code
total_clicksREALTotal clicks from country
total_impressionsREALTotal impressions in country
avg_ctr_pctREALAverage click-through rate percentage
avg_positionREALAverage ranking position

v_device_breakdown #

Device performance breakdown (DESKTOP, MOBILE, TABLET).

ColumnTypeDescription
site_urlTEXTProperty URL
deviceTEXTDevice category
total_clicksREALTotal clicks from device
total_impressionsREALTotal impressions on device
avg_ctr_pctREALAverage click-through rate percentage
avg_positionREALAverage ranking position

v_milestone_impact #

Pre vs post milestone comparison of organic search traffic.

ColumnTypeDescription
commit_hashTEXTMilestone identifier
milestone_titleTEXTTitle of the milestone
milestone_dateDATEEvent date (YYYY-MM-DD)
cohortTEXTPre-Milestone or Post-Milestone
days_trackedINTEGERNumber of days in cohort
total_clicksREALTotal clicks in cohort
total_impressionsREALTotal impressions in cohort
avg_ctr_pctREALAverage click-through rate percentage
avg_positionREALAverage ranking position