title: Using trigger to generate ID vs creating IDs manually
body: <p>If we have a sequence to generate unique ID fields for a table, which of the 2 approaches is more efficient:</p>
  
  <ol>
  <li>Create a trigger on insert, to populate the ID field by fetching nextval from sequence.</li>
  <li>Calling nextval on the sequence in the application layer before inserting the object (or tuple) in the db.</li>
  </ol>
  
  <p>EDIT: The application performs a mass upload. So assume thousands or a few millions of rows to be inserted each time the app runs. Would triggers from #1 be more efficient than calling the sequence within the app as mentioned in #2?</p>