How does micro partitions of snowflake works if we are inserting the data one by one in table and if we are loading the whole file? Will the number of micro partitions increases in case of loading the data one by one using inserts as compared to load the data from files?
1 Answers
Not sure what the purpose of the question is, but it is obviously MUCH better to batch load your file, rather than do individual record inserts, not just because of your question, but also because of the actual load performance.
As for your question, Snowflake will determine that if it has a single-record micropartition and you are inserting 1 additional record, it will create a new 2-record micropartition (assuming they aren't very large records). So, the active table won't have more micropartitions per se, but you will still have that single-record micropartition as part of your time-travel and fail-safe. So, if you were to do this 1 record at a time, over and over again, you'd have a lot of extra micropartitions to pay for.
Single-record inserts are just not a good idea in Snowflake. It's worth looking into ways to batch them up and load them in bulk.