Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9006979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:33:34+00:00 2026-06-16T01:33:34+00:00

I have a table in BigQuery with the following fields: time,a,b,c,d time is a

  • 0

I have a table in BigQuery with the following fields:

time,a,b,c,d

time is a string in ISO8601 format but with a space, a is an integer from 1 to 16000, and the other columns are strings. The table contains one month’s worth of data, and there are a few million records per day.

The following query fails with “response too large”:

select UTC_USEC_TO_DAY(PARSE_UTC_USEC(time)) as day,b,c,d,count(a),count(distinct a, 1000000)
from [myproject.mytable]
group by day,b,c,d
order by day,b,c,d asc

However, this query works (the data starts at 2012-01-01)

select UTC_USEC_TO_DAY(PARSE_UTC_USEC(time)) as day,
  b,c,d,count(a),count(distinct a)
from [myproject.mytable]
where UTC_USEC_TO_DAY(PARSE_UTC_USEC(time)) = UTC_USEC_TO_DAY(PARSE_UTC_USEC('2012-01-01 00:00:00'))
group by day,b,c,d
order by day,b,c,d asc

This looks like it might be related to this issue. However, because of the group by clause, the top query is equivalent to repeatedly calling the second query. Is the query planner not able to handle this?

Edit: To clarify my test data:

I am using fake test data I generated. I originally used several fields and tried to get hourly summaries for a month (group by hour, where hour is defined using as in the select part of the query). When that failed I tried switching to daily. When that failed I reduced the columns involved. That also failed when using a count (distinct xxx, 1000000), but it worked when I just did one day’s worth. (It also works if I remove the 1000000 parameter, but since that does work with the one-day query it seems the query planner is not separating things as I would expect.)

The one checked for count (distinct) has cardinality 16,000, and the group by columns have cardinality 2 and 20 for a total of just 1200 expected rows. Column values are quite short, around ten characters.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:33:35+00:00Added an answer on June 16, 2026 at 1:33 am

    How many results do you expect? There is currently a limitation of about 64MB in the total size of results that are allowed. If you’re expecting millions of rows as a result, than this may be an expected error.

    If the number of results isn’t extremely large, it may be that the size problem is not the final response, but the internal calculation. Specifically, if there are too many results from the GROUP BY, the query can run out of memory. One possible solution is to change “GROUP BY” to “GOUP EACH BY” which alters the way the query is executed. This is a feature that is currently experimental, and as such, is not yet documented.

    For your query, since you reference fields named in the select in the group by, you might need to do this:

    select day, b,c,d,day,count(a),count(distinct a, 1000000) 
    FROM (
        select UTC_USEC_TO_DAY(PARSE_UTC_USEC(time)) as day, b, c, d
        from [myproject.mytable]
    )
    group EACH by day,b,c,d
    order by day,b,c,d asc
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have table in which I am inserting rows for employee but next time
I have table with 300 000 records (MyISAM). I get record from this table
I have table View with grouped style with three sections. Get information from dictionary
I have table A with fields user1 and user2 and table B with user3
I have table with two columns (varchar from, varchar to). This table represents connections
I have table: test and field called: id. I want update time (ex. add
Have table and several div elements. Table is time grid and divs are events
i have table AuditLog with fields including: audited_id | audited_type That results in data
I have table with following details Table name EMPLOYEE and columns EMPID (PK smallint
I have table of products, and there are 2 fields: price, currency. Possible values

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.