I am creating the following schema:
CREATE TABLE stats_by_site_tracking_hourly (
d_tally text, -- 2016-02
d_date timestamp, -- 2016-02-01 13
site_id int,
is_new_member int, -- 1/0
device text, -- desktop/tablet/mobile/unknown
tracking_medium text,
tracking_source text,
tracking_campaign text,
tracking_term text,
accepted counter,
adjusted_accepted counter,
rejected counter,
adjusted_rejected counter,
error counter,
impressions_positive counter,
adjusted_impressions_positive counter,
impressions_negative counter,
adjusted_impressions_negative counter,
revenue counter,
adjusted_revenue counter,
reversals_rejected counter,
reversals_revenue counter,
PRIMARY KEY ((d_tally), site_id, d_date, is_new_member, device, tracking_medium, tracking_source, tracking_campaign, tracking_term)
);
When I run the statement, it seems that the first few columns are processed quickly however when it moves onto the counter columns it slows down more and more for every column.
I have left this statement running for 5 minutes and it still hasn't completed.
Could anyone offer some insight into this behaviour?
This is what CQLSH looks like as the table is being created, and when the screenshot was taken it hadn't progressed for 20 minutes or so.
I just put the create table command into one line and it worked instantly.
CREATE TABLE stats_by_site_tracking_hourly ( d_tally text, d_date timestamp, site_id int, is_new_member int, device text, tracking_medium text, tracking_source text, tracking_campaign text, tracking_term text, accepted counter, adjusted_accepted counter, rejected counter, adjusted_rejected counter, error counter, impressions_positive counter, adjusted_impressions_positive counter, impressions_negative counter, adjusted_impressions_negative counter, revenue counter, adjusted_revenue counter, reversals_rejected counter, reversals_revenue counter, PRIMARY KEY ((d_tally), site_id, d_date, is_new_member, device, tracking_medium, tracking_source, tracking_campaign, tracking_term) );
I raised this bug here: here
This turned out to be due to the tabs in the schema. CQLSH was trying to autocomplete each time it came to a tab.
I had this same issue on several computers and appears it's a bug in the cqlsh> interactive shell. If you execute the script from your terminal it will immediately execute:
> cqlsh -f your_cql_script.cql <hostname>
This runs immediately no matter what size tables and will save you LOTS of time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With