Does anyone knows if removing the field names from an INSERT query results in some performance improvements?
I mean is this:
INSERT INTO table1 VALUES (v
No, it's not faster. The database has to check which fields are in the table and match against the values anyway.
You should always specify the fields in the query to make the code more robust. If someone changes the order of the fields in the table, it stops working (or worse writes the data in the wrong field) if you haven't specified the fields.
I don't know of any performance improvement by omitting the field names but I would advise against it for anything other than testing/once-only inserts.
Readability will suffer (you have to check the table to see what is being inserted where) and your code will break if the table schema is changed
No, actually the contrary! At least for Microsoft SQL Server - you didn't specify what database you're talking about.....
If you don't specify the fields, either in a SELECT or an INSERT, then SQL Server's query processor must first go inspect the system catalogs to find out what fields are indeed available.
So I would always recommend to explicitly list the fields you want - on SELECTs as much as on INSERTs.