{"id":25277,"date":"2023-06-05T00:00:00","date_gmt":"2023-06-05T00:00:00","guid":{"rendered":"https:\/\/alienroad.com\/google-bilgi-bankasi\/bigquery-efficiency-tips-for-search-console-bulk-data-exports\/"},"modified":"2023-06-05T00:00:00","modified_gmt":"2023-06-05T00:00:00","slug":"bigquery-efficiency-tips-for-search-console-bulk-data-exports","status":"publish","type":"ar_kb","link":"https:\/\/alienroad.com\/google-bilgi-bankasi\/bigquery-efficiency-tips-for-search-console-bulk-data-exports\/","title":{"rendered":"BigQuery efficiency tips for Search Console bulk data exports"},"content":{"rendered":"<p class=\"gargardate\">Monday, June 5, 2023<\/p>\n<p>\nSearch Console <a href=\"https:\/\/alienroad.com\/google-bilgi-bankasi\/bulk-data-export-a-new-and-powerful-way-to-access-your-search-console-data\/\">bulk data export<\/a> is a powerful way<br \/>\n  to get your website&#8217;s search performance data into BigQuery to increase storage, analysis, and reporting<br \/>\n  capabilities. For example, after exporting the data, you can perform query and URL clustering, run<br \/>\n  analyses on long-tail search queries, and join search with other sources of data. You can also choose<br \/>\n  to retain the data for as long as you need it.\n<\/p>\n<p>\nWhen using Bulk data exports, it&#8217;s important to make informed decisions when managing the data processing<br \/>\n  and storage costs. There are no costs associated with Search Console to export the data; however, do read<br \/>\n  the <a href=\"https:\/\/cloud.google.com\/bigquery\/pricing\" class=\"external-link\">BigQuery pricing<\/a> to<br \/>\n  understand what you will be billed for. <strong>In this post, we&#8217;ll discuss tips to help you take advantage<br \/>\n  of the new data without incurring significant cost.<\/strong>\n<\/p>\n<p>\nIf you haven&#8217;t set up a bulk data export yet, check the <a href=\"https:\/\/support.google.com\/webmasters\/answer\/12917675\" class=\"external-link\">step-by-step guide<\/a><br \/>\n  in the Search Console help center. For an overview of the data available through the export, check the<br \/>\n  video embedded here.\n<\/p>\n<div class=\"video-wrapper-full-width\">\n<\/div>\n<h2 id=\"create-billing-alerts-and-restrictions\" tabindex=\"-1\">Create billing alerts and restrictions<\/h2>\n<p>\nWhen considering your costs, it might help to think through how much you&#8217;d be willing to spend. The answer<br \/>\n  to that question is likely to be different between storage, analysis, and monitoring. For example, you<br \/>\n  might be willing to pay a certain amount to make sure you&#8217;re storing all your data, but less to create<br \/>\n  a reporting platform. While thinking through that, you might want to set a monthly budget to invest in<br \/>\n  Search data.\n<\/p>\n<p>\nOnce you have a budget amount in mind, you can create a <a href=\"https:\/\/cloud.google.com\/billing\/docs\/how-to\/budgets\" class=\"external-link\">Google Cloud budget alert<\/a><br \/>\n  to avoid surprises on your bill. You can also set threshold rules that trigger email notifications when<br \/>\n  you&#8217;re advancing towards your budget amount.\n<\/p>\n<p>\n<img decoding=\"async\" src=\"https:\/\/alienroad.com\/wp-content\/uploads\/kb-gorsel\/g-f06cf92590c9.png\" loading=\"lazy\" width alt=\"Screenshot of Cloud Console showing how to create a billing alert\">\n<\/p>\n<p>\nFor added protection, you can also <a href=\"https:\/\/cloud.google.com\/bigquery\/docs\/best-practices-costs#limit_query_costs_by_restricting_the_number_of_bytes_billed\" class=\"external-link\">restrict the number of bytes billed<\/a><br \/>\n  for a query. If you do that, the number of bytes that the query will read is estimated before the query<br \/>\n  execution. If the number of estimated bytes is beyond the limit, then the query fails without incurring<br \/>\n  a charge.\n<\/p>\n<h2 id=\"dont-build-dashboards-directly-on-raw-data\" tabindex=\"-1\">Don&#8217;t build dashboards directly on raw data<\/h2>\n<p>\nBigQuery is fast, and it is tempting to link your dashboard directly to the Search Console exported tables.<br \/>\n  But for large sites, this dataset is very large (especially with over-time queries). If you build a<br \/>\n  dashboard that recomputes summary information on every view and share that within your company, this<br \/>\n  will quickly run up large query costs.\n<\/p>\n<p>\nTo avoid these costs, consider pre-aggregating the data from every daily drop and materializing one or<br \/>\n  more summary tables. Your dashboard can then query a much smaller time series table, decreasing processing<br \/>\n  costs.\n<\/p>\n<p>\nCheck the <a href=\"https:\/\/cloud.google.com\/bigquery\/docs\/scheduling-queries\" class=\"external-link\">scheduling queries<\/a><br \/>\nfunctionality in BigQuery, or consider <a href=\"https:\/\/cloud.google.com\/bigquery\/docs\/bi-engine-intro\" class=\"external-link\">BI Engine<\/a><br \/>\nif you&#8217;d like a more automated solution.\n<\/p>\n<h2 id=\"optimize-data-storage-costs\" tabindex=\"-1\">Optimize data storage costs<\/h2>\n<p>\nWhen you start a bulk data export, by default, data is kept forever in your BigQuery dataset. However,<br \/>\n  you can <a href=\"https:\/\/cloud.google.com\/bigquery\/docs\/updating-datasets#partition-expiration\" class=\"external-link\">update the default partition expiration times<\/a><br \/>\n  so that date partitions are automatically deleted after a year, or 16 months, or any duration you desire.\n<\/p>\n<p><aside class=\"warning\">Do not set an expiration time on the table, that will delete the entire table at the<br \/>\n  specified date!<\/aside>\n<\/p>\n<p>\nThe data exported can be valuable to you, but it can be very large. Use your business knowledge and consider<br \/>\n  retaining it long enough for deep analyses, but not too long that it becomes a burden. One option is to<br \/>\n  keep a sampled version of older tables while keeping the entire table of more recent dates.\n<\/p>\n<h2 id=\"optimize-your-sql-queries\" tabindex=\"-1\">Optimize your SQL queries<\/h2>\n<p>\nWhile querying your Search Console data, you should make sure your queries are optimized for performance. If you&#8217;re<br \/>\n  new to BigQuery, check the <a href=\"https:\/\/support.google.com\/webmasters\/answer\/12917174\" class=\"external-link\">guidelines and sample queries<\/a><br \/>\n  in the help center. There are three techniques you should try.\n<\/p>\n<h3 id=\"1.-limit-the-input-scan\" tabindex=\"-1\">1. Limit the input scan<\/h3>\n<p>\nFirst of all, <a href=\"https:\/\/cloud.google.com\/bigquery\/docs\/best-practices-costs#avoid_select_\" class=\"external-link\">avoid using <code>SELECT *<\/code><\/a>,<br \/>\n  this is the most expensive way to query the data, BigQuery does a full scan of every column in the table.<br \/>\n  Applying a <code>LIMIT<\/code> clause does <strong>not<\/strong> affect the amount of data read.\n<\/p>\n<p>\nSince the tables exported are date-partitioned, you can limit the input scan to only days of interest, especially<br \/>\n  when you&#8217;re testing and playing with the data. Use a <code>WHERE<\/code> clause to limit the date range<br \/>\n  in the date partitioned table, this will bring significant savings in query cost. For example, you can<br \/>\n  look only at the last 14 days using the following clause:\n<\/p>\n<p><div><\/div>\n<\/p>\n<p>\nFor every query you make you want to introduce any known filters as soon as possible to reduce the input scan.<br \/>\n  For example, if you are analyzing queries, you probably want to filter out<br \/>\n  <a href=\"https:\/\/alienroad.com\/google-bilgi-bankasi\/a-deep-dive-into-search-console-performance-data-filtering-and-limits\/#privacy-filtering\">anonymized queries<\/a> rows.<br \/>\n  An anonymized query is reported as a zero-length string in the table. To do so, you can add the following:\n<\/p>\n<p><div><\/div>\n<\/p>\n<h3 id=\"2.-sample-the-data\" tabindex=\"-1\">2. Sample the data<\/h3>\n<p>\nBigQuery provides a <a href=\"https:\/\/cloud.google.com\/bigquery\/docs\/table-sampling\" class=\"external-link\">table sampling<\/a><br \/>\n  capability, which lets you query random subsets of data from large BigQuery tables. Sampling returns a variety<br \/>\n  of records while avoiding the costs associated with scanning and processing an entire table, and is<br \/>\n  especially useful while developing queries, or when exact results are not needed.\n<\/p>\n<h3 id=\"3.-use-approximate-functions-where-exact-results-are-not-required\" tabindex=\"-1\">3. Use approximate functions where exact results are not required<\/h3>\n<p>\nBigQuery supports a number of <a href=\"https:\/\/cloud.google.com\/bigquery\/docs\/reference\/standard-sql\/approximate_aggregate_functions\" class=\"external-link\">approximate aggregation functions<\/a><br \/>\n  which provide estimated results and are much cheaper to compute than their exact counterparts. For example,<br \/>\n  if you are looking for the top URLs by impressions over some condition, you could use\n<\/p>\n<p><div><\/div>\n<\/p>\n<p>\nInstead of\n<\/p>\n<p><div><\/div>\n<\/p>\n<h2 id=\"resources\" tabindex=\"-1\">\u0420\u0435\u0441\u0443\u0440\u0441\u044b<\/h2>\n<p>\nThese are just a few tips you can use to start managing your costs, to learn more check the<br \/>\n  <a href=\"https:\/\/cloud.google.com\/blog\/products\/data-analytics\/cost-optimization-best-practices-for-bigquery\" class=\"external-link\">cost optimization best practices for BigQuery<\/a>.\n<\/p>\n<p>\nAnd as always, if you have any questions or concerns, please reach out to us via the<br \/>\n  <a href=\"https:\/\/support.google.com\/webmasters\/threads?thread_filter=(category:search_console)\" class=\"external-link\">Google Search Central Community<\/a><br \/>\n  or on <a href=\"https:\/\/twitter.com\/googlesearchc\" class=\"external-link\">Twitter<\/a>.\n<\/p>\n<p class=\"byline-author\">Posted by <a href=\"https:\/\/www.danielwaisberg.com\" class=\"external-link\">Daniel Waisberg<\/a>, Search Advocate, and Gaal Yahas, Software Engineer.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post, we discuss tips to help you take advantage of the Search Console bulk data exports without incurring significant cost in BigQuery<\/p>\n","protected":false},"menu_order":80487,"template":"","meta":{"footnotes":""},"ar_kb_kategori":[665],"ar_kb_etiket":[],"class_list":["post-25277","ar_kb","type-ar_kb","status-publish","has-post-thumbnail","hentry","ar_kb_kategori-blog"],"_links":{"self":[{"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb\/25277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb"}],"about":[{"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/types\/ar_kb"}],"version-history":[{"count":0,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb\/25277\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/media\/27397"}],"wp:attachment":[{"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/media?parent=25277"}],"wp:term":[{"taxonomy":"ar_kb_kategori","embeddable":true,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb_kategori?post=25277"},{"taxonomy":"ar_kb_etiket","embeddable":true,"href":"https:\/\/alienroad.com\/wp-json\/wp\/v2\/ar_kb_etiket?post=25277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}