0

Similar to GCP table creation taking a long time to create

I attempted to read the issuetracker in this comment, but I could not see the link destination.

What was the cause of this?

Maxim
  • 4,075
  • 1
  • 14
  • 23
  • I work on the Cloud Spanner team. Can you provide more details. How long has it taken? Have you made a lot of schema changes recently? Thanks – Mike Curtiss Jan 23 '18 at 05:46
  • Thanks Mike. These are the current data of my instance. **The node: 2**, **The number of databases: 3**, **The number of tables in the database (that table creation is slow): About 650**. It took about an hour from operation creation to completion in a long time. I am creating a new database and running it, but it will not be delayed so far (The number of tables in this newer database is currently 20 to 30). Are there problems such as slow table creation as the number of tables increases? – Hideyuki Okada Jan 23 '18 at 08:21
  • I'm testing flows CREATE TABLE -> CREATE INDEX -> DROP INDEX -> DELETE TABLE on the CI and are tested from several places in one test. The test runs in parallel, usually three tests, and in many cases six tests run. Each step may be called more than once depending on the test case. Does my answer make sense to your question (Have you made a lot of schema... ) ? – Hideyuki Okada Jan 23 '18 at 09:00
  • It is generally not recommended to run a regular series of tests that do expensive schema changes (e.g. CREATE INDEX). The process for creating an index can take several hours, and other schema changes will back up behind this. Ideally, you could create all of your tables and indexes in the same request where you create your database. And then periodically add new tables/indexes add needed. Do you have so many tables because you are attempting to create "multitenancy" (one table for each "customer")? In this case, you might want to have multiple databases and split your customers across them. – Mike Curtiss Jan 25 '18 at 07:00
  • As far as the problem is occurring only in the test environment, it seems to be caused by frequent schema changes as well. I will consider how to perform better tests. In the production environment, I am developing a function to create multiple tables for each customer, but I will reconsider the distribution of databases and tables. Thank you so much. – Hideyuki Okada Jan 29 '18 at 01:28

0 Answers0