Hi. I'm replicating a question I've asked on the W...
# sql
a
Hi. I'm replicating a question I've asked on the Working Code Podcast discord. Interested in hearing from anyone with MySQL DBA experience.
I am going to ask a contextless question because any context will influence the point of the question, and accordingly the answer.
THIS IS IMPORTANT: Any answers given should be from existing knowledge, and not from googling. I'm not testing ppl's ability to google stuff. I am trying to establish what "common knowledge" on the topic is.
MySQL "CREATE TABLE ... SELECT Statements". Any observations?
Cheers. Sorry it's vague.
s
I would say there is not much common knowledge on the subject. I know quite a bit from using it extensively, but having said that, it discredits my perspective. If I had to try and take a guess about its purpose (with a naive approach) it could “create a table from a select query”. Past that I think knowledge of weather it would produce a primary key, keep column type integrity, create indexes, what it might be used for, etc. would not be considered “common knowledge”
m
I can see it being used for working with server-side reports more efficiently. Say you generate a 10,000 row report with tons of calculations, and you want people to sort all sort of ways on the server... so you create your table with 10k rows, and now when the user sorts, all the heavy lifting is done.