Is it practical to dynamically normalize a table?

Let's say my database tracks bird watching (Note: I really clear the bottom of the trunk for examples).

Fields:

sighting_id | common_name | park_name | location | time | etc....

Although I assume that the park will always be in one place, the website will look like a spreadsheet. The user enters park_nameand locationfor each entry. Also note that in my real scheme there are other fields that also depend on a similar “park name” (for example, state).

I have no way to predefine parks, so I cannot know them in advance. Should I even try to dynamically normalize this data? For example, if my program automatically populates the table parksby replacing the park_name and location columns in the bird observation table with park_id?

I am worried about performance, basically. When listing each sight, a connection is required to fill the park and location. In addition, dynamically managing this will almost certainly require more resources than it will save. I probably would need a job at Kron to eliminate the orphaned parks, as they can be referenced in a few observations.

+3
source share
2 answers

It depends on your use. The normalized approach (the park is a table) will simplify the following queries:

  • How many bird observations were for each park.
  • In which park are you most likely to see a XYZ bird
  • There are probably a few more queries like

, . " XYZ , ", , .

, ... , , "123 Foo Street", ( "Foo Street" , . , , , - , , , - , .

, . , ? , , 99% , . -.

, , . , , , . .

, .

+3

"" ( OP):

: , , , , , (, , ), , "", , .

, "" . , , " ". , , , .

+2

All Articles