Tag Info

New answers tagged

0

I don't see where you are referencing the content of your CSV anywhere in what you posted.. (at least before any future edits). You should be using the COPY command. http://www.postgresql.org/docs/current/static/sql-copy.html EDIT Since Topic and Format tables appear to be lookup tables for referential integrity, the correct course of action would be to ...


2

Thanks for updating that you are using Microsoft SQL Server, which does support Full Text Indexing. (As do many other versions of SQL servers.) First of all your query is using a WHERE (Word LIKE @partialWord) which means that if there is a prefix wildcard (e.g. '%tion') the whole table has to be scanned and the contents of the Word column likewise scanned. ...


1

What you are looking for is to actually do the INSERT into warehouse_maine after Warehouse DELIMITER $$ DROP TRIGGER IF EXISTS Warehouse_InsertAfter $$ CREATE TRIGGER Warehouse_InsertAfter AFTER INSERT ON Warehouse FOR EACH ROW BEGIN IF NEW.state = 'maine' THEN INSERT IGNORE INTO warehouse_maine (shipperid, name, state) VALUES ...


1

You are using the wrong quotes for the SQL SUGGESTION #1 : Use Single Quotes for the SQL sudo mysql -e "USE books; INSERT INTO authors (id,name,email) VALUES(1,'test','gmail.com');" SUGGESTION #2 : Escape Double Quotes for SQL with Backslash (\) sudo mysql -e "USE books; INSERT INTO authors (id,name,email) VALUES(1,\"test\",\"gmail.com\");" The ...


5

What are the possible reasons of the slow table insert? What are ways to identify this bottleneck without the execution plan? Read How to analyse SQL Server performance, specially the part about Analyzing individual query execution wait times. What actions can I take to reduce the cost of the table insert? That would depend largely on the result ...


2

There are 3 possible kinds of duplicates: Duplicates within the rows of the bulk insert. That's your immediate cause for the exception. Duplicates between inserted rows and existing rows. Duplicates between inserted rows and concurrently inserted / updated rows from other transactions. 1. and 2. can be fixed easily. But you really need to define exactly ...


0

Map your columns in table having csv engine. For example following table have two columns, then data loaded in the resultant file could be looked up directly in it smliar to somewhat external tables in oracle. CREATE TABLE test (i INT NOT NULL, c CHAR(10) NOT NULL) ENGINE = CSV; Hope it helps.


2

Is the default setting for Sql Server comparable to "innodb_flush_log_at_trx_commit = 1" or to "innodb_flush_log_at_trx_commit = 2"? No. Assuming similar hardware, SQL Server should be just as slow as MySQL, since both would have to flush the commit for every row. Therefore there must be something else at play, very likely in the (not posted) C# code ...



Top 50 recent answers are included