Computer Webmaster Gaming Console Graphics Forum

Welcome to the Computer Webmaster Gaming Console Graphics Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Webmaster Forum > Website Coding > Database
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

Database Database problems or need to ask a question? maybe something to do with sql injections or a database software question. Database topics cover MySQL, PostgreSQL, Oracle, SQL Server or anything else related to databases.

Google
Closed Thread
 
LinkBack Thread Tools Display Modes
Old 06-10-2007, 12:25 AM   #1
J.R0wan
 
J.R0wan's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Index processing differences between 3.x and 4.x or 5.x

I have 600,000 plus record database which is updated nightly.
It currently runs under MySQL version 3.x. There are duplicate
records from the source which I eliminate by selecting from
one table where duplicates are allowed into another table where
there is a unique index defined on two fields, item,mfg.

In version 3.x selecting from the table with duplicates into the
table with the unique index effectively eliminates the duplicates.

Under version 4.x and 5.x the same selection statement causes the
program to terminate with an error when it encounters the first
duplicate.

I'm still searching through the documentation but if someone could
help me out with the syntax I would appreciate it.
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Advertisements
Old 06-10-2007, 12:25 AM   #2
J.R0wan
 
J.R0wan's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Index processing differences between 3.x and 4.x or 5.x

J.R0wan wrote:
> I have 600,000 plus record database which is updated nightly.
> It currently runs under MySQL version 3.x. There are duplicate
> records from the source which I eliminate by selecting from
> one table where duplicates are allowed into another table where
> there is a unique index defined on two fields, item,mfg.
>
> In version 3.x selecting from the table with duplicates into the
> table with the unique index effectively eliminates the duplicates.
>
> Under version 4.x and 5.x the same selection statement causes the
> program to terminate with an error when it encounters the first
> duplicate.
>
> I'm still searching through the documentation but if someone could
> help me out with the syntax I would appreciate it.

Ok, I have found my answer. I was not aware of the ignore option on an
insert statement. Starting with my table with dupes I use the command
below to copy into the table which requires unique values. Now I just
have to figure out what the 2033 Warnings were:

insert ignore into items2 (item,mfg) select /
substring(item,5,length(item)-4),substring(item,1,3) from afterprepwork;

Query OK, 534787 rows affected, 2033 warnings (10 min 1.67 sec)
Records: 822301 Duplicates: 287514 Warnings: 2033
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 06-10-2007, 12:25 AM   #3
Shawn
 
Shawn's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Index processing differences between 3.x and 4.x or 5.x

Hi J.R0wan,

J.R0wan wrote:
> J.R0wan wrote:
>> I have 600,000 plus record database which is updated nightly.
>> It currently runs under MySQL version 3.x. There are duplicate
>> records from the source which I eliminate by selecting from
>> one table where duplicates are allowed into another table where
>> there is a unique index defined on two fields, item,mfg.
>>
>> In version 3.x selecting from the table with duplicates into the
>> table with the unique index effectively eliminates the duplicates.
>>
>> Under version 4.x and 5.x the same selection statement causes the
>> program to terminate with an error when it encounters the first
>> duplicate.

<snip>
> Ok, I have found my answer. I was not aware of the ignore option on an
> insert statement. Starting with my table with dupes I use the command
> below to copy into the table which requires unique values. Now I just
> have to figure out what the 2033 Warnings were:
>
> insert ignore into items2 (item,mfg) select /
> substring(item,5,length(item)-4),substring(item,1,3) from afterprepwork;
>
> Query OK, 534787 rows affected, 2033 warnings (10 min 1.67 sec)
> Records: 822301 Duplicates: 287514 Warnings: 2033


SHOW WARNINGS will list those for you.
http://dev.mysql.com/doc/refman/4.1/...-warnings.html

Each time you ignore a duplicate record, one warning is generated. I
would assume that there were probably 2033 duplicates in your source table.
--
Shawn Green, Support Engineer
MySQL Inc., USA, www.mysql.com
Office: Blountville, TN

Are you MySQL certified? www.mysql.com/certification
 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Featured Websites
Free Space
Free Space
Free Space Free Space
Closed Thread
Tags: , , ,




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Browser Differences clarise Website Coding 12 01-20-2008 6:49 AM
Automatic image post-processing in PS7.x TMRDD Graphics in general 1 05-31-2007 6:36 PM
Should i buy a xbox360 or wait for the ps3, what are the differences Computer Consoles 2 05-30-2007 12:28 PM
* Email processing that REALLY WORKS..! miradox eNterprises Building An Internet Business 0 05-29-2007 1:41 AM


Featured Websites




All times are GMT +1. The time now is 4:42 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98