search

Home  >  Q&A  >  body text

Performance impact of creating tables in SQLite

In SQLite, there is a CREATE TABLE IF NOT EXISTS clause.

I can't find a reason why this is not good to use performance-wise.

For every SQLite query, I call this beforehand to make things easier.

Since SQLite is very fast, is there any problem with doing this? Is this just bad practice VS is there actually a performance bottleneck?

If that helps, I'm using this with PHP 7

P粉269847997P粉269847997310 days ago457

reply all(1)I'll reply

  • P粉704196697

    P粉7041966972024-01-29 12:20:26

    Use a database migration tool, such as https://phinx.org/, which can run your DML at deployment time. Database modifications should not be done by the user at runtime, even if the DML execution time is negligible

    reply
    0
  • Cancelreply