![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am currently creating a database with less than 20 simple tables (only SQL 92 types, simple constraints, no PostgreSQL specific stuff, no stored procedures...) Unfortunately, some of those tables will contain up to 4 Million entries, making the size of the entire database 700-1000MB. In order to maintain good query times (hopefully <1-3 seconds) I would like to ask for some tips on how to manage and organize such a database. Like what should I do and what should I avoid? Where and how should I use indexes and all that stuff? I know there are much larger PostgreSQL databases around. How do they manage good query times? Thanks a lot Matt P.S. The test system is a normal Win 2000 PC, the target machines will be IA-32 based Linux machines. ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org) |
#3
| |||
| |||
|
|
Do not use variable length types. |
#4
| |||
| |||
|
|
On Nov 19, 2004, at 2:37 AM, Jerry III wrote: Do not use variable length types. Why do you suggest not using variable length types? Patrick B. Kelly ------------------------------------------------------ http://patrickbkelly.org ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your message can get through to the mailing list cleanly |
#5
| |||
| |||
|
|
On Nov 19, 2004, at 2:37 AM, Jerry III wrote: Do not use variable length types. Why do you suggest not using variable length types? |
|
Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a tool for doing 5% of the work and then sitting around waiting for someone else to do the other 95% so you can sue them. |
#6
| |||
| |||
|
|
Especially since PostgreSQL has no fixed length string types, so following that advice would exclude any strings. That's kind of useless. |
#7
| |||
| |||
|
|
Especially since PostgreSQL has no fixed length string types, so following that advice would exclude any strings. That's kind of useless. char(n) ? |
|
Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a tool for doing 5% of the work and then sitting around waiting for someone else to do the other 95% so you can sue them. |
#8
| |||
| |||
|
|
Latin-9 5 bytes UTF-8 6 bytes UTF-16 10 bytes But it should still fit in a char(5), wouldn't you agree? |
|
In postgresql there is no difference in storage method between text, varchar(n) and char(n). |
#9
| |||
| |||
|
|
Latin-9 5 bytes UTF-8 6 bytes UTF-16 10 bytes But it should still fit in a char(5), wouldn't you agree? Got you. In postgresql there is no difference in storage method between text, varchar(n) and char(n). Learn something new every day. Thanks! |
#10
| |||
| |||
|
|
So that would say the previous statements are not accurate? That is, there's no problem with using a varchar? |
![]() |
| Thread Tools | |
| Display Modes | |
| |