[GLLUG] Is there any sane reason to do this? (Database question.)

John Winters john at sinodun.org.uk
Tue Oct 7 19:05:25 UTC 2014


I'm extracting data from a legacy (sort of - still actively sold) system
which has the following table:

(CSV dump of the table)


Days,DateIdent
2000-01-03 00:00:00.000,1
2000-01-05 00:00:00.000,2
2000-01-06 00:00:00.000,3
2000-01-07 00:00:00.000,4
2000-01-08 00:00:00.000,5
2000-01-10 00:00:00.000,6
2000-01-11 00:00:00.000,7

...

2031-04-29 00:00:00.000,10382
2031-04-30 00:00:00.000,10383
2031-05-01 00:00:00.000,10384
2031-05-02 00:00:00.000,10385
2031-05-03 00:00:00.000,10386
2031-05-04 00:00:00.000,10387

Then whenever another table in the database would normally have a column
of type "Date" it has column of type "Integer", which is used to index
into this table.

I'm no database guru, but this seems to me to be bordering on the
insane.  Apart from anything else, it means you have to error check
every attempt to retrieve a record with a date in it, in case the date
integer does not have a corresponding row in the Date table.

Is there a good design reason to do this?

Cheers,
John

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 551 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20141007/81c0291a/attachment.pgp>


More information about the GLLUG mailing list