threads
listlengths 1
275
|
---|
[
{
"msg_contents": "\n\n",
"msg_date": "Tue, 10 Sep 2002 08:40:44 +0200",
"msg_from": "Andreas Joseph Krogh <andreak@officenet.no>",
"msg_from_op": true,
"msg_subject": "subscribe"
}
] |
[
{
"msg_contents": "subscribe\n",
"msg_date": "Tue, 10 Sep 2002 13:31:10 +0100",
"msg_from": "\"Gavin Love\" <gavin@aardvarkmedia.co.uk>",
"msg_from_op": true,
"msg_subject": "subscribe"
}
] |
[
{
"msg_contents": "\n",
"msg_date": "Tue, 10 Sep 2002 11:20:23 -0400",
"msg_from": "Bryan White <bryan@arcamax.com>",
"msg_from_op": true,
"msg_subject": "subscribe"
}
] |
[
{
"msg_contents": "subscribe\n\n",
"msg_date": "Tue, 10 Sep 2002 10:07:06 -0600",
"msg_from": "Jason k Larson <postgresql@candlefire.org>",
"msg_from_op": true,
"msg_subject": "subscribe"
}
] |
[
{
"msg_contents": "subscribe\n\n",
"msg_date": "Tue, 10 Sep 2002 10:00:22 -0700",
"msg_from": "Ericson Smith <eric@did-it.com>",
"msg_from_op": true,
"msg_subject": "subscribe"
}
] |
[
{
"msg_contents": "\n-- \n\nKeith Gray\nTechnical Services Manager\nHeart Consulting Services\n\n",
"msg_date": "Wed, 11 Sep 2002 12:05:24 +1000",
"msg_from": "Keith Gray <keith@heart.com.au>",
"msg_from_op": true,
"msg_subject": "subscribe"
}
] |
[
{
"msg_contents": "subscribe\n",
"msg_date": "11 Sep 2002 11:00:03 -0000",
"msg_from": "nici.bertschler@berusoft.com",
"msg_from_op": true,
"msg_subject": "subscribe"
}
] |
[
{
"msg_contents": "subscribe\n\n\n------------------------------------------------------------------------------\n > Khusus Pelanggan Telepon DIVRE 2, Tekan 166 untuk mendengarkan pesan Anda\n ------------------------------------------------------------------------------\n",
"msg_date": "Wed, 11 Sep 2002 18:05:35 +0700",
"msg_from": "\"kopra\" <koprahome@telkom.net>",
"msg_from_op": true,
"msg_subject": "subscribe"
}
] |
[
{
"msg_contents": "Hi everyone,\n\nThere are PostgreSQL servers around that are handling 2,000 simultaneous\nclient connections (in real life) without problems, but no-one obvious\nseems to have yet taken the time to do fine grained testing of the\nservers which can take this kind of load, to accurately model their\nperformance characteristics.\n\nDoes anyone here happen to have fine grained benchmark/performance\nfigures hanging around which get into this range of performance? \nPreferably with pretty precise details of how the system was configured,\netc.\n\n:-)\n\nRegards and best wishes,\n\nJustin Clift\n\n-- \n\"My grandfather once told me that there are two kinds of people: those\nwho work and those who take the credit. He told me to try to be in the\nfirst group; there was less competition there.\"\n - Indira Gandhi\n",
"msg_date": "Sat, 14 Sep 2002 10:15:59 +1000",
"msg_from": "Justin Clift <justin@postgresql.org>",
"msg_from_op": true,
"msg_subject": "Anyone have any find grained benchmark data?"
}
] |
[
{
"msg_contents": "subscribe\n\n\n------------------------------------------------------------------------------\n > Khusus Pelanggan Telepon DIVRE 2, Tekan 166 untuk mendengarkan pesan Anda\n ------------------------------------------------------------------------------\n",
"msg_date": "Sat, 14 Sep 2002 19:28:03 +0700",
"msg_from": "\"kopra\" <koprahome@telkom.net>",
"msg_from_op": true,
"msg_subject": "subscribe"
}
] |
[
{
"msg_contents": "Hello all,\n\nSome time back I posted a query to build a site with 150GB of database. In last \ncouple of weeks, lots of things were tested at my place and there are some \nresults and again some concerns. \n\nThis is a long post. Please be patient and read thr. If we win this, I guess we \nhave a good marketing/advocacy case here..;-)\n\nFirst the problems (For those who do not read beyond first page)\n\n1) Database load time from flat file using copy is very high\n2) Creating index takes huge amount of time.\n3) Any suggsestions for runtime as data load and query will be going in \nparallel.\n\nNow the details. Note that this is a test run only..\n\nPlatform:- 4x Xeon2.4GHz/4GB RAM/4x48 SCSI RAID5/72 GB SCSI\nRedHat7.2/PostgreSQL7.1.3\n\nDatabase in flat file: \n125,000,000 records of around 100 bytes each. \nFlat file size 12GB\n\nLoad time: 14581 sec/~8600 rows persec/~ an MB of data per sec.\nCreate unique composite index on 2 char and a timestamp field: 25226 sec.\nDatabase size on disk: 26GB\nSelect query: 1.5 sec. for approx. 150 rows.\n\nImportant postgresql.conf settings\n\nsort_mem = 12000\nshared_buffers = 24000\nfsync=true (Sad but true. Left untouched.. Will that make a difference on \nSCSI?)\nwal_buffers = 65536 \nwal_files = 64 \n\nNow the requirements\n\nInitial flat data load: 250GB of data. This has gone up since last query. It \nwas 150GB earlier..\nOngoing inserts: 5000/sec. \nNumber of queries: 4800 queries/hour\nQuery response time: 10 sec.\n\n\nNow questions.\n\n1) Instead of copying from a single 12GB data file, will a parallel copy from \nsay 5 files will speed up the things? \n\nCouple MB of data per sec. to disk is just not saturating it. It's a RAID 5 \nsetup..\n\n2) Sort mem.=12K i.e. 94MB, sounds good enough to me. Does this need further \naddition to improve create index performance?\n\n3) 5K concurrent inserts with an index on, will this need a additional CPU \npower? Like deploying it on dual RISC CPUs etc? \n\n4) Query performance is not a problem. Though 4.8K queries per sec. expected \nresponse time from each query is 10 sec. But my guess is some serius CPU power \nwill be chewed there too..\n\n5)Will upgrading to 7.2.2/7.3 beta help?\n\nAll in all, in the test, we didn't see the performance where hardware is \nsaturated to it's limits. So effectively we are not able to get postgresql \nmaking use of it. Just pushing WAL and shared buffers does not seem to be the \nsolution.\n\nIf you guys have any suggestions. let me know. I need them all..\n\nMysql is almost out because it's creating index for last 17 hours. I don't \nthink it will keep up with 5K inserts per sec. with index. SAP DB is under \nevaluation too. But postgresql is most favourite as of now because it works. So \nI need to come up with solutions to problems that will occur in near future..\n;-)\n\nTIA..\n\nBye\n Shridhar\n\n--\nLaw of Procrastination:\tProcrastination avoids boredom; one never has\tthe \nfeeling that there is nothing important to do.\n\n",
"msg_date": "Thu, 26 Sep 2002 14:05:44 +0530",
"msg_from": "\"Shridhar Daithankar\" <shridhar_daithankar@persistent.co.in>",
"msg_from_op": true,
"msg_subject": "Performance while loading data and indexing"
},
{
"msg_contents": "On 26 Sep 2002 at 14:05, Shridhar Daithankar wrote:\n> Some time back I posted a query to build a site with 150GB of database. In last \n> couple of weeks, lots of things were tested at my place and there are some \n> results and again some concerns. \n\n> 2) Creating index takes huge amount of time.\n> Load time: 14581 sec/~8600 rows persec/~ an MB of data per sec.\n> Create unique composite index on 2 char and a timestamp field: 25226 sec.\n> Database size on disk: 26GB\n> Select query: 1.5 sec. for approx. 150 rows.\n\n> 2) Sort mem.=12K i.e. 94MB, sounds good enough to me. Does this need further \n> addition to improve create index performance?\n\nJust a thought. If I sort the table before making an index, would it be faster \nthan creating index on raw table? And/or if at all, how do I sort the table \nwithout duplicating it?\n\nJust a wild thought..\n\nBye\n Shridhar\n\n--\nlinux: the choice of a GNU generation(ksh@cis.ufl.edu put this on Tshirts in \n'93)\n\n",
"msg_date": "Thu, 26 Sep 2002 14:24:02 +0530",
"msg_from": "\"Shridhar Daithankar\" <shridhar_daithankar@persistent.co.in>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "I'll preface this by saying that while I have a large database, it doesn't\nrequire quite the performace you're talking about here.\n\nOn Thu, Sep 26, 2002 at 02:05:44PM +0530, Shridhar Daithankar wrote:\n> 1) Database load time from flat file using copy is very high\n> 2) Creating index takes huge amount of time.\n> 3) Any suggsestions for runtime as data load and query will be going in \n> parallel.\n\nYou're loading all the data in one copy. I find that INSERTs are mostly\nlimited by indexes. While index lookups are cheap, they are not free and\neach index needs to be updated for each row.\n\nI fond using partial indexes to only index the rows you actually use can\nhelp with the loading. It's a bit obscure though.\n\nAs for parallel loading, you'll be limited mostly by your I/O bandwidth.\nHave you measured it to take sure it's up to speed?\n\n> Now the details. Note that this is a test run only..\n> \n> Platform:- 4x Xeon2.4GHz/4GB RAM/4x48 SCSI RAID5/72 GB SCSI\n> RedHat7.2/PostgreSQL7.1.3\n> \n> Database in flat file: \n> 125,000,000 records of around 100 bytes each. \n> Flat file size 12GB\n> \n> Load time: 14581 sec/~8600 rows persec/~ an MB of data per sec.\n> Create unique composite index on 2 char and a timestamp field: 25226 sec.\n> Database size on disk: 26GB\n> Select query: 1.5 sec. for approx. 150 rows.\n\nSo you're loading at a rate of 860KB per sec. That's not too fast. How many\nindexes are active at that time? Triggers and foreign keys also take their\ntoll.\n\n> Important postgresql.conf settings\n> \n> sort_mem = 12000\n> shared_buffers = 24000\n> fsync=true (Sad but true. Left untouched.. Will that make a difference on \n> SCSI?)\n> wal_buffers = 65536 \n> wal_files = 64 \n\nfsync IIRC only affects the WAL buffers now but it may be quite expensive,\nespecially considering it's running on every transaction commit. Oh, your\nWAL files are on a seperate disk from the data?\n\n> Initial flat data load: 250GB of data. This has gone up since last query. It \n> was 150GB earlier..\n> Ongoing inserts: 5000/sec. \n> Number of queries: 4800 queries/hour\n> Query response time: 10 sec.\n\nThat looks quite acheivable.\n\n> 1) Instead of copying from a single 12GB data file, will a parallel copy from \n> say 5 files will speed up the things? \n\nLimited by I/O bandwidth. On linux vmstat can tell you how many blocks are\nbeing loaded and stored per second. Try it. As long as sync() doesn't get\ndone too often, it should be help.\n\n> Couple MB of data per sec. to disk is just not saturating it. It's a RAID 5 \n> setup..\n\nNo, it's not. You should be able to do better.\n\n> 2) Sort mem.=12K i.e. 94MB, sounds good enough to me. Does this need further \n> addition to improve create index performance?\n\nShould be fine. Admittedly your indexes are taking rather long to build.\n\n> 3) 5K concurrent inserts with an index on, will this need a additional CPU \n> power? Like deploying it on dual RISC CPUs etc? \n\nIt shouldn't. Do you have an idea of what your CPU usage is? ps aux should\ngive you a decent idea.\n\n> 4) Query performance is not a problem. Though 4.8K queries per sec. expected \n> response time from each query is 10 sec. But my guess is some serius CPU power \n> will be chewed there too..\n\nShould be fine.\n\n> 5)Will upgrading to 7.2.2/7.3 beta help?\n\nPossibly, though it may be wirth it just for the features/bugfixes.\n\n> All in all, in the test, we didn't see the performance where hardware is \n> saturated to it's limits. So effectively we are not able to get postgresql \n> making use of it. Just pushing WAL and shared buffers does not seem to be the \n> solution.\n> \n> If you guys have any suggestions. let me know. I need them all..\n\nFind the bottleneck: CPU, I/O or memory?\n\n> Mysql is almost out because it's creating index for last 17 hours. I don't \n> think it will keep up with 5K inserts per sec. with index. SAP DB is under \n> evaluation too. But postgresql is most favourite as of now because it works. So \n> I need to come up with solutions to problems that will occur in near future..\n> ;-)\n\n17 hours! Ouch. Either way, you should be able to do much better. Hope this\nhelps,\n-- \nMartijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/\n> There are 10 kinds of people in the world, those that can do binary\n> arithmetic and those that can't.\n",
"msg_date": "Thu, 26 Sep 2002 19:05:19 +1000",
"msg_from": "Martijn van Oosterhout <kleptog@svana.org>",
"msg_from_op": false,
"msg_subject": "Re: Performance while loading data and indexing"
},
{
"msg_contents": "On 26 Sep 2002 at 10:51, paolo.cassago@talentmanager.c wrote:\n\n> Hi,\n> it seems you have to cluster it, I don't think you have another choise.\n\nHmm.. That didn't occur to me...I guess some real time clustering like usogres \nwould do. Unless it turns out to be a performance hog..\n\nBut this is just insert and select. No updates no deletes(Unless customer makes \na 180 degree turn) So I doubt if clustering will help. At the most I can \nreplicate data across machines and spread queries on them. Replication overhead \nas a down side and low query load on each machine as upside..\n\n> I'm retrieving the configuration of our postgres servers (I'm out of office\n> now), so I can send it to you. I was quite disperate about performance, and\n> I was thinking to migrate the data on an oracle database. Then I found this\n> configuration on the net, and I had a succesfull increase of performance.\n\nIn this case, we are upto postgresql because we/our customer wants to keep the \ncosts down..:-) Even they are asking now if it's possible to keep hardware \ncosts down as well. That's getting some funny responses here but I digress..\n\n> Maybe this can help you.\n> \n> Why you use copy to insert records? I usually use perl scripts, and they\n> work well .\n\nPerformance reasons. As I said in one of my posts earlier, putting upto 100K \nrecords in one transaction in steps of 10K did not reach performance of copy. \nAs Tom said rightly, it was a 4-1 ratio despite using transactions..\n\nThanks once again..\nBye\n Shridhar\n\n--\nSecretary's Revenge:\tFiling almost everything under \"the\".\n\n",
"msg_date": "Thu, 26 Sep 2002 14:43:20 +0530",
"msg_from": "\"Shridhar Daithankar\" <shridhar_daithankar@persistent.co.in>",
"msg_from_op": true,
"msg_subject": "Re: Performance while loading data and indexing"
},
{
"msg_contents": "Hi Shridhar,\n\nShridhar Daithankar wrote:\n<snip>\n> 3) Any suggsestions for runtime as data load and query will be going in\n> parallel.\n\nThat sounds unusual. From reading this, it *sounds* like you'll be\nrunning queries against an incomplete dataset, or maybe just running the\nqueries that affect the tables loaded thus far (during the initial\nload).\n\n<snip>\n> fsync=true (Sad but true. Left untouched.. Will that make a difference on\n> SCSI?)\n\nDefinitely. Have directly measured a ~ 2x tps throughput increase on\nFreeBSD when leaving fsync off whilst performance measuring stuff\nrecently (PG 7.2.2). Like anything it'll depend on workload, phase of\nmoon, etc, but it's a decent indicator.\n\n<snip>\n> Now questions.\n> \n> 1) Instead of copying from a single 12GB data file, will a parallel copy from\n> say 5 files will speed up the things?\n\nNot sure yet. Haven't get done enough performance testing (on the cards\nvery soon though).\n\n> Couple MB of data per sec. to disk is just not saturating it. It's a RAID 5\n> setup..\n\nfsync = off would help during the data load, but not a good idea if\nyou're going to be running queries against it at the same time.\n\nAm still getting the hang of performance tuning stuff. Have a bunch of\nUltra160 hardware for the Intel platform, and am testing against it as\ntime permits.\n\nNot as high end as I'd like, but it's a start.\n\n:-)\n\nRegards and best wishes,\n\nJustin Clift\n\n<snip>\n> Bye\n> Shridhar\n\n-- \n\"My grandfather once told me that there are two kinds of people: those\nwho work and those who take the credit. He told me to try to be in the\nfirst group; there was less competition there.\"\n - Indira Gandhi\n",
"msg_date": "Thu, 26 Sep 2002 19:17:32 +1000",
"msg_from": "Justin Clift <justin@postgresql.org>",
"msg_from_op": false,
"msg_subject": "Re: Performance while loading data and indexing"
},
{
"msg_contents": "On 26 Sep 2002 at 19:17, Justin Clift wrote:\n> Shridhar Daithankar wrote:\n> <snip>\n> > 3) Any suggsestions for runtime as data load and query will be going in\n> > parallel.\n> \n> That sounds unusual. From reading this, it *sounds* like you'll be\n> running queries against an incomplete dataset, or maybe just running the\n> queries that affect the tables loaded thus far (during the initial\n> load).\n\nThat's correct. Load the data so far and keep inserting data as and when it \ngenerates.\n\nThey don't mind running against data so far. It's not very accurate stuff \nIMO...\n\n> > fsync=true (Sad but true. Left untouched.. Will that make a difference on\n> > SCSI?)\n> \n> Definitely. Have directly measured a ~ 2x tps throughput increase on\n> FreeBSD when leaving fsync off whilst performance measuring stuff\n> recently (PG 7.2.2). Like anything it'll depend on workload, phase of\n> moon, etc, but it's a decent indicator.\n\nI didn't know even that matters with SCSI..Will check out..\n\n> fsync = off would help during the data load, but not a good idea if\n> you're going to be running queries against it at the same time.\n\nThat's OK for the reasons mentioned above. It wouldn't be out of place to \nexpect a UPS to such an installation...\n\nBye\n Shridhar\n\n--\nHoare's Law of Large Problems:\tInside every large problem is a small problem \nstruggling to get out.\n\n",
"msg_date": "Thu, 26 Sep 2002 15:05:40 +0530",
"msg_from": "\"Shridhar Daithankar\" <shridhar_daithankar@persistent.co.in>",
"msg_from_op": true,
"msg_subject": "Re: Performance while loading data and indexing"
},
{
"msg_contents": "On 26 Sep 2002 at 19:05, Martijn van Oosterhout wrote:\n\n> On Thu, Sep 26, 2002 at 02:05:44PM +0530, Shridhar Daithankar wrote:\n> > 1) Database load time from flat file using copy is very high\n> > 2) Creating index takes huge amount of time.\n> > 3) Any suggsestions for runtime as data load and query will be going in \n> > parallel.\n> \n> You're loading all the data in one copy. I find that INSERTs are mostly\n> limited by indexes. While index lookups are cheap, they are not free and\n> each index needs to be updated for each row.\n> \n> I fond using partial indexes to only index the rows you actually use can\n> help with the loading. It's a bit obscure though.\n> \n> As for parallel loading, you'll be limited mostly by your I/O bandwidth.\n> Have you measured it to take sure it's up to speed?\n\nWell. It's like this, as of now.. CreateDB->create table->create index->Select.\n\nSo loading is not slowed by index. As of your hint of vmstat, will check it \nout.\n> So you're loading at a rate of 860KB per sec. That's not too fast. How many\n> indexes are active at that time? Triggers and foreign keys also take their\n> toll.\n\nNothing except the table where data os loaded..\n\n> fsync IIRC only affects the WAL buffers now but it may be quite expensive,\n> especially considering it's running on every transaction commit. Oh, your\n> WAL files are on a seperate disk from the data?\n\nNo. Same RAID 5 disks..\n\n> It shouldn't. Do you have an idea of what your CPU usage is? ps aux should\n> give you a decent idea.\n\nI guess we forgot to monitor system parameters. Next on my list is running \nvmstat, top and tuning bdflush.\n \n> Find the bottleneck: CPU, I/O or memory?\n\nUnderstood..\n> \n> > Mysql is almost out because it's creating index for last 17 hours. I don't \n> > think it will keep up with 5K inserts per sec. with index. SAP DB is under \n> > evaluation too. But postgresql is most favourite as of now because it works. So \n> > I need to come up with solutions to problems that will occur in near future..\n> > ;-)\n> \n> 17 hours! Ouch. Either way, you should be able to do much better. Hope this\n> helps,\n\nHeh.. no wonder this evaluation is taking more than 2 weeks.. Mysql was running \nout of disk space while creating index and crashin. An upgrade to mysql helped \nthere but no numbers as yet..\n\nThanks once again...\nBye\n Shridhar\n\n--\nBoren's Laws:\t(1) When in charge, ponder.\t(2) When in trouble, delegate.\t(3) \nWhen in doubt, mumble.\n\n",
"msg_date": "Thu, 26 Sep 2002 15:16:50 +0530",
"msg_from": "\"Shridhar Daithankar\" <shridhar_daithankar@persistent.co.in>",
"msg_from_op": true,
"msg_subject": "Re: Performance while loading data and indexing"
},
{
"msg_contents": "On Thursday 26 Sep 2002 9:35 am, Shridhar Daithankar wrote:\n\n[questions re: large database]\n\nBefore reading my advice please bear in mind you are operating way beyond the \nscale of anything I have ever built.\n\n> Now the details. Note that this is a test run only..\n>\n> Platform:- 4x Xeon2.4GHz/4GB RAM/4x48 SCSI RAID5/72 GB SCSI\n> RedHat7.2/PostgreSQL7.1.3\n>\n> Database in flat file:\n> 125,000,000 records of around 100 bytes each.\n> Flat file size 12GB\n>\n> Load time: 14581 sec/~8600 rows persec/~ an MB of data per sec.\n> Create unique composite index on 2 char and a timestamp field: 25226 sec.\n> Database size on disk: 26GB\n> Select query: 1.5 sec. for approx. 150 rows.\n>\n> Important postgresql.conf settings\n[snipped setting details for moment]\n\nHave you tried putting the wal files, syslog etc on separate disks/volumes? If \nyou've settled on Intel, about the only thing you can optimise further is the \ndisks.\n\nOh - and the OS - make sure you're running a (good) recent kernel for that \nsort of hardware, I seem to remember some substantial changes in the 2.4 \nseries regarding multi-processor.\n\n> Now the requirements\n>\n> Initial flat data load: 250GB of data. This has gone up since last query.\n> It was 150GB earlier..\n> Ongoing inserts: 5000/sec.\n> Number of queries: 4800 queries/hour\n> Query response time: 10 sec.\n\nIs this 5000 rows in say 500 transactions or 5000 insert transactions per \nsecond. How many concurrent clients is this? Similarly for the 4800 queries, \nhow many concurrent clients is this? Are they expected to return approx 150 \nrows as in your test?\n\n> Now questions.\n>\n> 1) Instead of copying from a single 12GB data file, will a parallel copy\n> from say 5 files will speed up the things?\n\nIf the CPU is the bottle-neck then it should, but it's difficult to say \nwithout figures.\n\n> Couple MB of data per sec. to disk is just not saturating it. It's a RAID 5\n> setup..\n\nWhat is saturating during the flat-file load? Something must be maxed in top / \niostat / vmstat.\n\n[snip]\n>\n> 5)Will upgrading to 7.2.2/7.3 beta help?\n\nIt's unlikely to hurt.\n\n> All in all, in the test, we didn't see the performance where hardware is\n> saturated to it's limits.\n\nSomething *must* be.\n\nWhat are your disaster recovery plans? I can see problems with taking backups \nif this beast is live 24/7.\n\n- Richard Huxton\n",
"msg_date": "Thu, 26 Sep 2002 10:48:06 +0100",
"msg_from": "Richard Huxton <dev@archonet.com>",
"msg_from_op": false,
"msg_subject": "Re: Performance while loading data and indexing"
},
{
"msg_contents": "Shridhar Daithankar wrote:\n<snip>\n> > > fsync=true (Sad but true. Left untouched.. Will that make a difference on\n> > > SCSI?)\n> >\n> > Definitely. Have directly measured a ~ 2x tps throughput increase on\n> > FreeBSD when leaving fsync off whilst performance measuring stuff\n> > recently (PG 7.2.2). Like anything it'll depend on workload, phase of\n> > moon, etc, but it's a decent indicator.\n> \n> I didn't know even that matters with SCSI..Will check out..\n\nCool. When testing it had FreeBSD 4.6.2 installed on one drive along\nwith the PostgreSQL 7.2.2 binaries, it had the data on a second drive\n(mounted as /pgdata), and it had the pg_xlog directory mounted on a\nthird drive. Swap had it's own drive as well.\n\nEverything is UltraSCSI, etc. Haven't yet tested for a performance\ndifference through moving the indexes to another drive after creation\nthough. That apparently has the potential to help as well.\n\n:-)\n\nRegards and best wishes,\n\nJustin Clift\n\n-- \n\"My grandfather once told me that there are two kinds of people: those\nwho work and those who take the credit. He told me to try to be in the\nfirst group; there was less competition there.\"\n - Indira Gandhi\n",
"msg_date": "Thu, 26 Sep 2002 19:49:53 +1000",
"msg_from": "Justin Clift <justin@postgresql.org>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "Shridhar Daithankar wrote:\n> \n> On 26 Sep 2002 at 19:05, Martijn van Oosterhout wrote:\n<snip>\n> > fsync IIRC only affects the WAL buffers now but it may be quite expensive,\n> > especially considering it's running on every transaction commit. Oh, your\n> > WAL files are on a seperate disk from the data?\n> \n> No. Same RAID 5 disks..\n\nNot sure if this is a good idea. Would have to think deeply about the\ncontroller and drive optimisation/load characteristics.\n\nIf it's any help, when I was testing recently with WAL on a separate\ndrive, the WAL logs were doing more read&writes per second than the main\ndata drive. This would of course be affected by the queries you are\nrunning against the database. I was just running Tatsuo's TPC-B stuff,\nand the OSDB AS3AP tests.\n\n> I guess we forgot to monitor system parameters. Next on my list is running\n> vmstat, top and tuning bdflush.\n\nThat'll just be the start of it for serious performance tuning and\nlearning how PostgreSQL works. :)\n\n<snip>\n> Thanks once again...\n> Bye\n> Shridhar\n\n-- \n\"My grandfather once told me that there are two kinds of people: those\nwho work and those who take the credit. He told me to try to be in the\nfirst group; there was less competition there.\"\n - Indira Gandhi\n",
"msg_date": "Thu, 26 Sep 2002 19:56:34 +1000",
"msg_from": "Justin Clift <justin@postgresql.org>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "\"Shridhar Daithankar\" <shridhar_daithankar@persistent.co.in> writes:\n> RedHat7.2/PostgreSQL7.1.3\n\nI'd suggest a newer release of Postgres ... 7.1.3 is pretty old ...\n\n> Create unique composite index on 2 char and a timestamp field: 25226 sec.\n\nWhat do you mean by \"char\" exactly? If it's really char(N), how much\nare you paying in padding space? There are very very few cases where\nI'd not say to use varchar(N), or text, instead. Also, does it have to\nbe character data? If you could use an integer or float datatype\ninstead the index operations should be faster (though I can't say by\nhow much). Have you thought carefully about the order in which the\ncomposite index columns are listed?\n\n> sort_mem = 12000\n\nTo create an index of this size, you want to push sort_mem as high as it\ncan go without swapping. 12000 sounds fine for the global setting, but\nin the process that will create the index, try setting sort_mem to some\nhundreds of megs or even 1Gb. (But be careful: the calculation of space\nactually used by CREATE INDEX is off quite a bit in pre-7.3 releases\n:-(. You should probably expect the actual process size to grow to two\nor three times what you set sort_mem to. Don't let it get so big as to\nswap.)\n\n> wal_buffers = 65536 \n\nThe above is a complete waste of memory space, which would be better\nspent on letting the kernel expand its disk cache. There's no reason\nfor wal_buffers to be more than a few dozen.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 26 Sep 2002 10:33:58 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Performance while loading data and indexing "
},
{
"msg_contents": "Justin Clift <justin@postgresql.org> writes:\n>> On 26 Sep 2002 at 19:05, Martijn van Oosterhout wrote:\n>>> fsync IIRC only affects the WAL buffers now but it may be quite expensive,\n>>> especially considering it's running on every transaction commit. Oh, your\n>>> WAL files are on a seperate disk from the data?\n\n> Not sure if this is a good idea. Would have to think deeply about the\n> controller and drive optimisation/load characteristics.\n\n> If it's any help, when I was testing recently with WAL on a separate\n> drive, the WAL logs were doing more read&writes per second than the main\n> data drive.\n\n... but way fewer seeks. For anything involving lots of updating\ntransactions (and certainly 5000 separate insertions per second would\nqualify; can those be batched??), it should be a win to put WAL on its\nown spindle, just to get locality of access to the WAL.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 26 Sep 2002 10:42:08 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing "
},
{
"msg_contents": "On 26 Sep 2002 at 10:33, Tom Lane wrote:\n\n> \"Shridhar Daithankar\" <shridhar_daithankar@persistent.co.in> writes:\n> > RedHat7.2/PostgreSQL7.1.3\n> \n> I'd suggest a newer release of Postgres ... 7.1.3 is pretty old ...\n\nI agree.. downloadind 7.2.2 right away..\n\n> > Create unique composite index on 2 char and a timestamp field: 25226 sec.\n> \n> What do you mean by \"char\" exactly? If it's really char(N), how much\n> are you paying in padding space? There are very very few cases where\n> I'd not say to use varchar(N), or text, instead. Also, does it have to\n> be character data? If you could use an integer or float datatype\n> instead the index operations should be faster (though I can't say by\n> how much). Have you thought carefully about the order in which the\n> composite index columns are listed?\n\nI have forwarded the idea of putting things into number. If it causes speedup \nin index lookup/creation, it would do. Looks like bigint is the order of the \nday..\n\n> \n> > sort_mem = 12000\n> \n> To create an index of this size, you want to push sort_mem as high as it\n> can go without swapping. 12000 sounds fine for the global setting, but\n> in the process that will create the index, try setting sort_mem to some\n> hundreds of megs or even 1Gb. (But be careful: the calculation of space\n> actually used by CREATE INDEX is off quite a bit in pre-7.3 releases\n> :-(. You should probably expect the actual process size to grow to two\n> or three times what you set sort_mem to. Don't let it get so big as to\n> swap.)\n\nGreat. I was skeptical to push it beyond 100MB. Now I can push it to corners..\n\n> > wal_buffers = 65536 \n> \n> The above is a complete waste of memory space, which would be better\n> spent on letting the kernel expand its disk cache. There's no reason\n> for wal_buffers to be more than a few dozen.\n\nThat was a rather desparate move. Nothing was improving performance and then we \nstarted pushing numbers.. WIll get it back.. Same goes for 64 WAL files.. A GB \nlooks like waste to me..\n\nI might have found the bottleneck, although by accident. Mysql was running out \nof space while creating index. So my friend shut down mysql and tried to move \nthings by hand to create links. He noticed that even things like cp were \nterribly slow and it hit us.. May be the culprit is the file system. Ext3 in \nthis case. \n\nMy friend argues for ext2 to eliminate journalling overhead but I favour \nreiserfs personally having used it in pgbench with 10M rows on paltry 20GB IDE \ndisk for 25 tps..\n\nWe will be attempting raiserfs and/or XFS if required. I know how much speed \ndifference exists between resiserfs and ext2. Would not be surprised if \neverythng just starts screaming in one go..\n\nBye\n Shridhar\n\n--\nCropp's Law:\tThe amount of work done varies inversly with the time spent in the\t\noffice.\n\n",
"msg_date": "Thu, 26 Sep 2002 20:22:05 +0530",
"msg_from": "\"Shridhar Daithankar\" <shridhar_daithankar@persistent.co.in>",
"msg_from_op": true,
"msg_subject": "Re: Performance while loading data and indexing "
},
{
"msg_contents": "On 26 Sep 2002 at 10:42, Tom Lane wrote:\n\n> Justin Clift <justin@postgresql.org> writes:\n> > If it's any help, when I was testing recently with WAL on a separate\n> > drive, the WAL logs were doing more read&writes per second than the main\n> > data drive.\n> \n> ... but way fewer seeks. For anything involving lots of updating\n> transactions (and certainly 5000 separate insertions per second would\n> qualify; can those be batched??), it should be a win to put WAL on its\n> own spindle, just to get locality of access to the WAL.\n\nProbably they will be a single transcation. If possible we will bunch more of \nthem together.. like 5 seconds of data pushed down in a single transaction but \nnot sure it's possible..\n\nThis is bit like replication but from live oracle machine to postgres, from \ninformation I have. So there should be some chance of tuning there..\n\nBye\n Shridhar\n\n--\nLangsam's Laws:\t(1) Everything depends.\t(2) Nothing is always.\t(3) Everything \nis sometimes.\n\n",
"msg_date": "Thu, 26 Sep 2002 20:28:11 +0530",
"msg_from": "\"Shridhar Daithankar\" <shridhar_daithankar@persistent.co.in>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing "
},
{
"msg_contents": "On Thursday 26 September 2002 21:52, Shridhar Daithankar wrote:\n\n> I might have found the bottleneck, although by accident. Mysql was running\n> out of space while creating index. So my friend shut down mysql and tried\n> to move things by hand to create links. He noticed that even things like cp\n> were terribly slow and it hit us.. May be the culprit is the file system.\n> Ext3 in this case.\n>\n> My friend argues for ext2 to eliminate journalling overhead but I favour\n> reiserfs personally having used it in pgbench with 10M rows on paltry 20GB\n> IDE disk for 25 tps..\n>\n> We will be attempting raiserfs and/or XFS if required. I know how much\n> speed difference exists between resiserfs and ext2. Would not be surprised\n> if everythng just starts screaming in one go..\n\nAs it was found by someone before any non-journaling FS is faster than\njournaling one. This due to double work done by FS and database.\n\nTry it on ext2 and compare.\n\n--\nDenis\n\n",
"msg_date": "Thu, 26 Sep 2002 22:04:41 +0700",
"msg_from": "Denis Perchine <dyp@perchine.com>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "Shridhar Daithankar wrote:\n<snip>\n> My friend argues for ext2 to eliminate journalling overhead but I favour\n> reiserfs personally having used it in pgbench with 10M rows on paltry 20GB IDE\n> disk for 25 tps..\n\nIf it's any help, the setup I mentioned before with differnt disks for\nthe data and the WAL files was getting an average of about 72 tps with\n200 concurrent users on pgbench. Haven't tuned it in a hard core way at\nall, and it only has 256MB DDR RAM in it at the moment (single CPU\nAthonXP 1600). These are figures made during the 2.5k+ test runs of\npgbench done when developing pg_autotune recently.\n\nAs a curiosity point, how predictable are the queries you're going to be\nrunning on your database? They sound very simple and very predicatable.\n\nThe pg_autotune tool might be your friend here. It can deal with\narbitrary SQL instead of using the pg_bench stuff of Tatsuos, and it can\nalso deal with an already loaded database. You'd just have to tweak the\nnames of the tables that it vacuums and the names of the indexes that it\nreindexes between each run, to get some idea of your overall server\nperformance at different load points.\n\nProbably worth taking a good look at if you're not afraid of editing\nvariables in C code. :)\n \n> We will be attempting raiserfs and/or XFS if required. I know how much speed\n> difference exists between resiserfs and ext2. Would not be surprised if\n> everythng just starts screaming in one go..\n\nWe'd all probably be interested to hear this. Added the PostgreSQL\n\"Performance\" mailing list to this thread too, Just In Case. (wow that's\na lot of cross posting now).\n\nRegards and best wishes,\n\nJustin Clift\n \n> Bye\n> Shridhar\n> \n> --\n> Cropp's Law: The amount of work done varies inversly with the time spent in the\n> office.\n> \n> ---------------------------(end of broadcast)---------------------------\n> TIP 3: if posting/reading through Usenet, please send an appropriate\n> subscribe-nomail command to majordomo@postgresql.org so that your\n> message can get through to the mailing list cleanly\n\n-- \n\"My grandfather once told me that there are two kinds of people: those\nwho work and those who take the credit. He told me to try to be in the\nfirst group; there was less competition there.\"\n - Indira Gandhi\n",
"msg_date": "Fri, 27 Sep 2002 01:12:49 +1000",
"msg_from": "Justin Clift <justin@postgresql.org>",
"msg_from_op": false,
"msg_subject": "Re: Performance while loading data and indexing"
},
{
"msg_contents": "On 27 Sep 2002 at 1:12, Justin Clift wrote:\n\n> Shridhar Daithankar wrote:\n> As a curiosity point, how predictable are the queries you're going to be\n> running on your database? They sound very simple and very predicatable.\n\nMostly predictable selects. Not a domain expert on telecom so not very sure. \nBut in my guess prepare statement in 7.3 should come pretty handy. i.e. by the \ntime we finish evaluation and test deployment, 7.3 will be out in next couple \nof months to say so. So I would recommend doing it 7.3 way only..\n> \n> The pg_autotune tool might be your friend here. It can deal with\n> arbitrary SQL instead of using the pg_bench stuff of Tatsuos, and it can\n> also deal with an already loaded database. You'd just have to tweak the\n> names of the tables that it vacuums and the names of the indexes that it\n> reindexes between each run, to get some idea of your overall server\n> performance at different load points.\n> \n> Probably worth taking a good look at if you're not afraid of editing\n> variables in C code. :)\n\nGladly. We started with altering pgbench here for testing and rapidly settled \nto perl generated random queries. Once postgresql wins the evaluation match and \nthings come to implementation, pg_autotune would be a handy tool. Just that \ncan't do it right now. Have to fight mysql and SAP DB before that..\n\nBTW any performance figures on SAP DB? People here are as it frustrated with it \nwith difficulties in setting it up. But still..\n> \n\n> > We will be attempting raiserfs and/or XFS if required. I know how much speed\n> > difference exists between resiserfs and ext2. Would not be surprised if\n> > everythng just starts screaming in one go..\n> \n> We'd all probably be interested to hear this. Added the PostgreSQL\n> \"Performance\" mailing list to this thread too, Just In Case. (wow that's\n> a lot of cross posting now).\n\nI know..;-) Glad that PG list does not have strict policies like no non-\nsubscriber posting or no attachments.. etc.. \n\nIMO reiserfs, though journalling one, is faster than ext2 etc. because the way \nit handles metadata. Personally I haven't come across ext2 being faster than \nreiserfs on few machine here for day to day use.\n\nI guess I should have a freeBSD CD handy too.. Just to give it a try. If it \ncomes down to a better VM.. though using 2.4.19 here.. so souldn't matter \nmuch..\n\nI will keep you guys posted on file system stuff... Glad that we have much \nflexibility with postgresql..\n\nBye\n Shridhar\n\n--\nBilbo's First Law:\tYou cannot count friends that are all packed up in barrels.\n\n",
"msg_date": "Thu, 26 Sep 2002 20:59:01 +0530",
"msg_from": "\"Shridhar Daithankar\" <shridhar_daithankar@persistent.co.in>",
"msg_from_op": true,
"msg_subject": "Re: Performance while loading data and indexing"
},
{
"msg_contents": "On Thu, 2002-09-26 at 09:52, Shridhar Daithankar wrote:\n> My friend argues for ext2 to eliminate journalling overhead but I favour \n> reiserfs personally having used it in pgbench with 10M rows on paltry 20GB IDE \n> disk for 25 tps..\n> \n> We will be attempting raiserfs and/or XFS if required. I know how much speed \n> difference exists between resiserfs and ext2. Would not be surprised if \n> everythng just starts screaming in one go..\n> \n\nI'm not sure about reiserfs or ext3 but with XFS, you can create your\nlog on another disk. Also worth noting is that you can also configure\nthe size and number of log buffers. There are also some other\nperformance type enhancements you can fiddle with if you don't mind\nrisking time stamp consistency in the event of a crash. If your setup\nallows for it, you might want to consider using XFS in this\nconfiguration.\n\nWhile I have not personally tried moving XFS' log to another device,\nI've heard that performance gains can be truly stellar. Assuming memory\nallows, twiddling with the log buffering is said to allow for large\nstrides in performance as well.\n\nIf you do try this, I'd love to hear back about your results and\nimpressions.\n\nGreg",
"msg_date": "26 Sep 2002 10:41:37 -0500",
"msg_from": "Greg Copeland <greg@CopelandConsulting.Net>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "Shridhar Daithankar wrote:\n> I might have found the bottleneck, although by accident. Mysql was running out \n> of space while creating index. So my friend shut down mysql and tried to move \n> things by hand to create links. He noticed that even things like cp were \n> terribly slow and it hit us.. May be the culprit is the file system. Ext3 in \n> this case. \n\nI just added a file system and multi-cpu section to my performance\ntuning paper:\n\n\thttp://www.ca.postgresql.org/docs/momjian/hw_performance/\n\nThe paper does recommend ext3, but the differences between file systems\nare very small. If you are seeing 'cp' as slow, I wonder if it may be\nsomething more general, like poorly tuned hardware or something. You can\nuse 'dd' to throw some data around the file system and see if that is\nshowing slowness; compare those numbers to another machine that has\ndifferent hardware/OS.\n\nAlso, though ext3 is slower, turning fsync off should make ext3 function\nsimilar to ext2. That would be an interesting test if you suspect ext3.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 359-1001\n + If your life is a hard drive, | 13 Roberts Road\n + Christ can be your backup. | Newtown Square, Pennsylvania 19073\n",
"msg_date": "Thu, 26 Sep 2002 12:41:34 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: Performance while loading data and indexing"
},
{
"msg_contents": "Greg Copeland <greg@CopelandConsulting.Net> writes:\n\n> I'm not sure about reiserfs or ext3 but with XFS, you can create your\n> log on another disk. Also worth noting is that you can also configure\n> the size and number of log buffers. There are also some other\n> performance type enhancements you can fiddle with if you don't mind\n> risking time stamp consistency in the event of a crash. If your setup\n> allows for it, you might want to consider using XFS in this\n> configuration.\n\nYou can definitely put the ext3 log on a different disk with 2.4\nkernels. \n\nAlso, if you put the WAL logs on a different disk from the main\ndatabase, and mount that partition with 'data=writeback' (ie\nmetadata-only journaling) ext3 should be pretty fast, since WAL files\nare preallocated and there will therefore be almost no metadata\nupdates.\n\nYou should be able to mount the main database with \"data=ordered\" (the\ndefault) for good performance and reasonable safety.\n\nI think putting WAL on its own disk(s) is one of the keys here.\n\n-Doug\n",
"msg_date": "26 Sep 2002 13:16:36 -0400",
"msg_from": "Doug cNaught <doug@wireboard.com>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "On Thu, 2002-09-26 at 11:41, Bruce Momjian wrote:\n> Shridhar Daithankar wrote:\n> > I might have found the bottleneck, although by accident. Mysql was running out \n> > of space while creating index. So my friend shut down mysql and tried to move \n> > things by hand to create links. He noticed that even things like cp were \n> > terribly slow and it hit us.. May be the culprit is the file system. Ext3 in \n> > this case. \n> \n> I just added a file system and multi-cpu section to my performance\n> tuning paper:\n> \n> \thttp://www.ca.postgresql.org/docs/momjian/hw_performance/\n> \n> The paper does recommend ext3, but the differences between file systems\n> are very small. If you are seeing 'cp' as slow, I wonder if it may be\n> something more general, like poorly tuned hardware or something. You can\n> use 'dd' to throw some data around the file system and see if that is\n> showing slowness; compare those numbers to another machine that has\n> different hardware/OS.\n\n\nThat's a good point. Also, if you're using IDE, you do need to verify\nthat you're using DMA and proper PIO mode if at possible. Also, big\nperformance improvements can be seen by making sure your IDE bus speed\nhas been properly configured. The drivetweak-gtk and hdparm utilities\ncan make huge difference in performance. Just be sure you know what the\nheck your doing when you mess with those.\n\nGreg",
"msg_date": "26 Sep 2002 12:36:57 -0500",
"msg_from": "Greg Copeland <greg@CopelandConsulting.Net>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "On Thu, 2002-09-26 at 11:41, Bruce Momjian wrote:\n> Shridhar Daithankar wrote:\n> > I might have found the bottleneck, although by accident. Mysql was running out \n> > of space while creating index. So my friend shut down mysql and tried to move \n> > things by hand to create links. He noticed that even things like cp were \n> > terribly slow and it hit us.. May be the culprit is the file system. Ext3 in \n> > this case. \n> \n> I just added a file system and multi-cpu section to my performance\n> tuning paper:\n> \n> \thttp://www.ca.postgresql.org/docs/momjian/hw_performance/\n> \n> The paper does recommend ext3, but the differences between file systems\n> are very small. If you are seeing 'cp' as slow, I wonder if it may be\n> something more general, like poorly tuned hardware or something. You can\n> use 'dd' to throw some data around the file system and see if that is\n> showing slowness; compare those numbers to another machine that has\n> different hardware/OS.\n> \n> Also, though ext3 is slower, turning fsync off should make ext3 function\n> similar to ext2. That would be an interesting test if you suspect ext3.\n\nI'm curious as to why you recommended ext3 versus some other (JFS,\nXFS). Do you have tests which validate that recommendation or was it a\nsimple matter of getting the warm fuzzies from familiarity?\n\nGreg",
"msg_date": "26 Sep 2002 12:44:22 -0500",
"msg_from": "Greg Copeland <greg@CopelandConsulting.Net>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "If you are seeing very slow performance on a drive set, check dmesg to see \nif you're getting SCSI bus errors or something similar. If your drives \naren't properly terminated then the performance will suffer a great deal.\n\n",
"msg_date": "Thu, 26 Sep 2002 12:41:55 -0600 (MDT)",
"msg_from": "\"scott.marlowe\" <scott.marlowe@ihs.com>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "Greg Copeland wrote:\n> > The paper does recommend ext3, but the differences between file systems\n> > are very small. If you are seeing 'cp' as slow, I wonder if it may be\n> > something more general, like poorly tuned hardware or something. You can\n> > use 'dd' to throw some data around the file system and see if that is\n> > showing slowness; compare those numbers to another machine that has\n> > different hardware/OS.\n> > \n> > Also, though ext3 is slower, turning fsync off should make ext3 function\n> > similar to ext2. That would be an interesting test if you suspect ext3.\n> \n> I'm curious as to why you recommended ext3 versus some other (JFS,\n> XFS). Do you have tests which validate that recommendation or was it a\n> simple matter of getting the warm fuzzies from familiarity?\n\nI used the attached email as a reference. I just changed the wording to\nbe:\n\t\n\tFile system choice is particularly difficult on Linux because there are\n\tso many file system choices, and none of them are optimal: ext2 is not\n\tentirely crash-safe, ext3 and xfs are journal-based, and Reiser is\n\toptimized for small files. Fortunately, the journaling file systems\n\taren't significantly slower than ext2 so they are probably the best\n\tchoice.\n\nso I don't specifically recommend ext3 anymore. As I remember, ext3 is\ngood only in that it can read ext2 file systems. I think XFS may be the\nbest bet.\n\nCan anyone clarify if \"data=writeback\" is safe for PostgreSQL. \nSpecifically, are the data files recovered properly or is this option\nonly for a filesystem containing WAL?\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 359-1001\n + If your life is a hard drive, | 13 Roberts Road\n + Christ can be your backup. | Newtown Square, Pennsylvania 19073",
"msg_date": "Thu, 26 Sep 2002 16:00:48 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> The paper does recommend ext3, but the differences between file systems\n> are very small.\n\nWell, I only did a very rough benchmark (a few runs of pgbench), but\nthe results I found were drastically different: ext2 was significantly\nfaster (~50%) than ext3-writeback, which was in turn significantly\nfaster (~25%) than ext3-ordered.\n\n> Also, though ext3 is slower, turning fsync off should make ext3 function\n> similar to ext2.\n\nWhy would that be?\n\nCheers,\n\nNeil\n\n-- \nNeil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC\n\n",
"msg_date": "26 Sep 2002 16:41:49 -0400",
"msg_from": "Neil Conway <neilc@samurai.com>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "Neil Conway wrote:\n> Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> > The paper does recommend ext3, but the differences between file systems\n> > are very small.\n> \n> Well, I only did a very rough benchmark (a few runs of pgbench), but\n> the results I found were drastically different: ext2 was significantly\n> faster (~50%) than ext3-writeback, which was in turn significantly\n> faster (~25%) than ext3-ordered.\n\nWow. That leaves no good Linux file system alternatives. PostgreSQL\njust wants an ordinary file system that has reliable recovery from a\ncrash.\n\n> > Also, though ext3 is slower, turning fsync off should make ext3 function\n> > similar to ext2.\n> \n> Why would that be?\n\nI assumed it was the double fsync for the normal and journal that made\nthe journalling file systems slog.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 359-1001\n + If your life is a hard drive, | 13 Roberts Road\n + Christ can be your backup. | Newtown Square, Pennsylvania 19073\n",
"msg_date": "Thu, 26 Sep 2002 16:45:54 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "I have seen various benchmarks where XFS seems to perform best when it \ncomes to huge amounts of data and many files (due to balanced internal \nb+ trees).\nalso, XFS seems to be VERY mature and very stable.\next2/3 don't seem to be that fast in most of the benchmarks.\n\ni did some testing with reiser some time ago. the problem is that it \nseems to restore a very historic consistent snapshot of the data. XFS \nseems to be much better in this respect.\n\ni have not tested JFS yet (but on this damn AIX beside me)\nfrom my point of view i strongly recommend XFS (maybe somebody from \nRedHat should think about it).\n\n Hans\n\n\nNeil Conway wrote:\n\n>Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> \n>\n>>The paper does recommend ext3, but the differences between file systems\n>>are very small.\n>> \n>>\n>\n>Well, I only did a very rough benchmark (a few runs of pgbench), but\n>the results I found were drastically different: ext2 was significantly\n>faster (~50%) than ext3-writeback, which was in turn significantly\n>faster (~25%) than ext3-ordered.\n>\n> \n>\n>>Also, though ext3 is slower, turning fsync off should make ext3 function\n>>similar to ext2.\n>> \n>>\n>\n>Why would that be?\n>\n>Cheers,\n>\n>Neil\n>\n> \n>\n\n\n-- \n*Cybertec Geschwinde u Schoenig*\nLudo-Hartmannplatz 1/14, A-1160 Vienna, Austria\nTel: +43/1/913 68 09; +43/664/233 90 75\nwww.postgresql.at <http://www.postgresql.at>, cluster.postgresql.at \n<http://cluster.postgresql.at>, www.cybertec.at \n<http://www.cybertec.at>, kernel.cybertec.at <http://kernel.cybertec.at>\n\n",
"msg_date": "Thu, 26 Sep 2002 22:55:30 +0200",
"msg_from": "=?ISO-8859-1?Q?Hans-J=FCrgen_Sch=F6nig?= <postgres@cybertec.at>",
"msg_from_op": false,
"msg_subject": "Re: [GENERAL] Performance while loading data and indexing"
},
{
"msg_contents": "Neil Conway wrote:\n> Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> > The paper does recommend ext3, but the differences between file systems\n> > are very small.\n> \n> Well, I only did a very rough benchmark (a few runs of pgbench), but\n> the results I found were drastically different: ext2 was significantly\n> faster (~50%) than ext3-writeback, which was in turn significantly\n> faster (~25%) than ext3-ordered.\n> \n> > Also, though ext3 is slower, turning fsync off should make ext3 function\n> > similar to ext2.\n> \n> Why would that be?\n\nOK, I changed the text to:\n\t\n\tFile system choice is particularly difficult on Linux because there are\n\tso many file system choices, and none of them are optimal: ext2 is not\n\tentirely crash-safe, ext3, xfs, and jfs are journal-based, and Reiser is\n\toptimized for small files and does journalling. The journalling file\n\tsystems can be significantly slower than ext2 but when crash recovery is\n\trequired, ext2 isn't an option.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 359-1001\n + If your life is a hard drive, | 13 Roberts Road\n + Christ can be your backup. | Newtown Square, Pennsylvania 19073\n",
"msg_date": "Thu, 26 Sep 2002 16:57:03 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> Wow. That leaves no good Linux file system alternatives.\n> PostgreSQL just wants an ordinary file system that has reliable\n> recovery from a crash.\n\nI'm not really familiar with the reasoning behind ext2's reputation as\nrecovering poorly from crashes; if we fsync a WAL record to disk\nbefore we lose power, can't we recover reliably, even with ext2?\n\n> > > Also, though ext3 is slower, turning fsync off should make ext3\n> > > function similar to ext2.\n> > \n> > Why would that be?\n> \n> I assumed it was the double fsync for the normal and journal that\n> made the journalling file systems slog.\n\nWell, a journalling file system would need to write a journal entry\nand flush that to disk, even if fsync is disabled -- whereas without\nfsync enabled, ext2 doesn't have to flush anything to disk. ISTM that\nthe performance advantage of ext2 over ext3 is should be even larger\nwhen fsync is not enabled.\n\nCheers,\n\nNeil\n\n-- \nNeil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC\n\n",
"msg_date": "26 Sep 2002 17:03:26 -0400",
"msg_from": "Neil Conway <neilc@samurai.com>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "I tend to agree with this though I have nothing to back up it with. My\nimpression is that XFS does very well for large files. Accepting that\nas fact?, my impression is that XFS historically does well for\ndatabase's. Again, I have nothing to back that up other than hear-say\nand conjecture.\n\nGreg\n\n\nOn Thu, 2002-09-26 at 15:55, Hans-Jürgen Schönig wrote:\n> I have seen various benchmarks where XFS seems to perform best when it \n> comes to huge amounts of data and many files (due to balanced internal \n> b+ trees).\n> also, XFS seems to be VERY mature and very stable.\n> ext2/3 don't seem to be that fast in most of the benchmarks.\n> \n> i did some testing with reiser some time ago. the problem is that it \n> seems to restore a very historic consistent snapshot of the data. XFS \n> seems to be much better in this respect.\n> \n> i have not tested JFS yet (but on this damn AIX beside me)\n> from my point of view i strongly recommend XFS (maybe somebody from \n> RedHat should think about it).\n> \n> Hans\n> \n> \n> Neil Conway wrote:\n> \n> >Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> > \n> >\n> >>The paper does recommend ext3, but the differences between file systems\n> >>are very small.\n> >> \n> >>\n> >\n> >Well, I only did a very rough benchmark (a few runs of pgbench), but\n> >the results I found were drastically different: ext2 was significantly\n> >faster (~50%) than ext3-writeback, which was in turn significantly\n> >faster (~25%) than ext3-ordered.\n> >\n> > \n> >\n> >>Also, though ext3 is slower, turning fsync off should make ext3 function\n> >>similar to ext2.\n> >> \n> >>\n> >\n> >Why would that be?\n> >\n> >Cheers,\n> >\n> >Neil\n> >\n> > \n> >\n> \n> \n> -- \n> *Cybertec Geschwinde u Schoenig*\n> Ludo-Hartmannplatz 1/14, A-1160 Vienna, Austria\n> Tel: +43/1/913 68 09; +43/664/233 90 75\n> www.postgresql.at <http://www.postgresql.at>, cluster.postgresql.at \n> <http://cluster.postgresql.at>, www.cybertec.at \n> <http://www.cybertec.at>, kernel.cybertec.at <http://kernel.cybertec.at>\n> \n> \n> ---------------------------(end of broadcast)---------------------------\n> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org",
"msg_date": "26 Sep 2002 16:03:51 -0500",
"msg_from": "Greg Copeland <greg@CopelandConsulting.Net>",
"msg_from_op": false,
"msg_subject": "Re: [GENERAL] Performance while loading data and indexing"
},
{
"msg_contents": "Has there been any thought of providing RAW disk support to bypass the fs?\n\n-----Original Message-----\nFrom: pgsql-hackers-owner@postgresql.org\n[mailto:pgsql-hackers-owner@postgresql.org]On Behalf Of Bruce Momjian\nSent: Thursday, September 26, 2002 3:57 PM\nTo: Neil Conway\nCc: shridhar_daithankar@persistent.co.in; pgsql-hackers@postgresql.org;\npgsql-general@postgresql.org\nSubject: Re: [HACKERS] [GENERAL] Performance while loading data and\nindexing\n\n\nNeil Conway wrote:\n> Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> > The paper does recommend ext3, but the differences between file systems\n> > are very small.\n>\n> Well, I only did a very rough benchmark (a few runs of pgbench), but\n> the results I found were drastically different: ext2 was significantly\n> faster (~50%) than ext3-writeback, which was in turn significantly\n> faster (~25%) than ext3-ordered.\n>\n> > Also, though ext3 is slower, turning fsync off should make ext3 function\n> > similar to ext2.\n>\n> Why would that be?\n\nOK, I changed the text to:\n\n\tFile system choice is particularly difficult on Linux because there are\n\tso many file system choices, and none of them are optimal: ext2 is not\n\tentirely crash-safe, ext3, xfs, and jfs are journal-based, and Reiser is\n\toptimized for small files and does journalling. The journalling file\n\tsystems can be significantly slower than ext2 but when crash recovery is\n\trequired, ext2 isn't an option.\n\n--\n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 359-1001\n + If your life is a hard drive, | 13 Roberts Road\n + Christ can be your backup. | Newtown Square, Pennsylvania 19073\n\n---------------------------(end of broadcast)---------------------------\nTIP 5: Have you checked our extensive FAQ?\n\nhttp://www.postgresql.org/users-lounge/docs/faq.html\n\n",
"msg_date": "Thu, 26 Sep 2002 16:06:07 -0500",
"msg_from": "\"James Maes\" <jmaes@materialogic.com>",
"msg_from_op": false,
"msg_subject": "Re: [GENERAL] Performance while loading data and indexing"
},
{
"msg_contents": "Neil Conway wrote:\n> Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> > Wow. That leaves no good Linux file system alternatives.\n> > PostgreSQL just wants an ordinary file system that has reliable\n> > recovery from a crash.\n> \n> I'm not really familiar with the reasoning behind ext2's reputation as\n> recovering poorly from crashes; if we fsync a WAL record to disk\n> before we lose power, can't we recover reliably, even with ext2?\n> \n> > > > Also, though ext3 is slower, turning fsync off should make ext3\n> > > > function similar to ext2.\n> > > \n> > > Why would that be?\n> > \n> > I assumed it was the double fsync for the normal and journal that\n> > made the journalling file systems slog.\n> \n> Well, a journalling file system would need to write a journal entry\n> and flush that to disk, even if fsync is disabled -- whereas without\n> fsync enabled, ext2 doesn't have to flush anything to disk. ISTM that\n> the performance advantage of ext2 over ext3 is should be even larger\n> when fsync is not enabled.\n\nYes, it is still double-writing. I just thought that if that wasn't\nhappening while the db was waiting for a commit that it wouldn't be too\nbad.\n\nIs it just me or do all the Linux file systems seem like they are\nlacking something when PostgreSQL is concerned? We just want a UFS-like\nfile system on Linux and no one has it.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 359-1001\n + If your life is a hard drive, | 13 Roberts Road\n + Christ can be your backup. | Newtown Square, Pennsylvania 19073\n",
"msg_date": "Thu, 26 Sep 2002 17:07:57 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "On Thu, 2002-09-26 at 16:03, Neil Conway wrote:\n> Bruce Momjian <pgman@candle.pha.pa.us> writes:\n> > Wow. That leaves no good Linux file system alternatives.\n> > PostgreSQL just wants an ordinary file system that has reliable\n> > recovery from a crash.\n> \n> I'm not really familiar with the reasoning behind ext2's reputation as\n> recovering poorly from crashes; if we fsync a WAL record to disk\n> before we lose power, can't we recover reliably, even with ext2?\n\nWell, I have experienced data loss from ext2 before. Also, recovery\nfrom crashes on large file systems take a very, very long time. I can't\nimagine anyone running a production database on an ext2 file system\nhaving 10's or even 100's of GB. Ouch. Recovery would take forever! \nEven recovery on small file systems (2-8G) can take extended periods of\ntime. Especially so on IDE systems. Even then manual intervention is\nnot uncommon.\n\nWhile I can't say that x, y or z is the best FS to use on Linux, I can\nsay that ext2 is probably an exceptionally poor choice from a\nreliability and/or uptime perspective.\n\nGreg",
"msg_date": "26 Sep 2002 16:09:15 -0500",
"msg_from": "Greg Copeland <greg@CopelandConsulting.Net>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "Greg Copeland <greg@CopelandConsulting.Net> writes:\n> On Thu, 2002-09-26 at 16:03, Neil Conway wrote:\n> > I'm not really familiar with the reasoning behind ext2's\n> > reputation as recovering poorly from crashes; if we fsync a WAL\n> > record to disk before we lose power, can't we recover reliably,\n> > even with ext2?\n> \n> Well, I have experienced data loss from ext2 before. Also, recovery\n> from crashes on large file systems take a very, very long time.\n\nYes, but wouldn't you face exactly the same issues if you ran a\nUFS-like filesystem in asynchronous mode? Albeit it's not the default,\nbut performance in synchronous mode is usually pretty poor.\n\nThe fact that ext2 defaults to asynchronous mode and UFS (at least on\nthe BSDs) defaults to synchronous mode seems like a total non-issue to\nme. Is there any more to the alleged difference in reliability?\n\nCheers,\n\nNeil\n\n-- \nNeil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC\n\n",
"msg_date": "26 Sep 2002 17:17:30 -0400",
"msg_from": "Neil Conway <neilc@samurai.com>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "Bruce Momjian <pgman@candle.pha.pa.us> writes:\n\n> Can anyone clarify if \"data=writeback\" is safe for PostgreSQL. \n> Specifically, are the data files recovered properly or is this option\n> only for a filesystem containing WAL?\n\n\"data=writeback\" means that no data is journaled, just metadata (which\nis like XFS or Reiser). An fsync() call should still do what it\nnormally does, commit the writes to disk before returning.\n\n\"data=journal\" journals all data and is the slowest and safest.\n\"data=ordered\" writes out data blocks before committing a journal\ntransaction, which is faster than full data journaling (since data\ndoesn't get written twice) and almost as safe. \"data=writeback\" is\nnoted to keep obsolete data in the case of some crashes (since the\ndata may not have been written yet) but a completed fsync() should\nensure that the data is valid.\n\nSo I guess I'd probably use data=ordered for an all-on-one-fs\ninstallation, and data=writeback for a WAL-only drive.\n\nHope this helps...\n\n-Doug\n",
"msg_date": "26 Sep 2002 17:31:55 -0400",
"msg_from": "Doug McNaught <doug@wireboard.com>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "Neil Conway <neilc@samurai.com> writes:\n> I'm not really familiar with the reasoning behind ext2's reputation as\n> recovering poorly from crashes; if we fsync a WAL record to disk\n> before we lose power, can't we recover reliably, even with ext2?\n\nUp to a point. We do assume that the filesystem won't lose checkpointed\n(sync'd) writes to data files. To the extent that the filesystem is\nvulnerable to corruption of its own metadata for a file (indirect blocks\nor whatever ext2 uses), that's not a completely safe assumption.\n\nWe'd be happiest with a filesystem that journals its own metadata and\nnot the user data in the file(s). I dunno if there are any.\n\nHmm, maybe this is why Oracle likes doing their own filesystem on a raw\ndevice...\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 26 Sep 2002 17:32:01 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing "
},
{
"msg_contents": "Tom Lane <tgl@sss.pgh.pa.us> writes:\n\n> We'd be happiest with a filesystem that journals its own metadata and\n> not the user data in the file(s). I dunno if there are any.\n\next3 with data=writeback? (See my previous message to Bruce).\n\n-Doug\n",
"msg_date": "26 Sep 2002 17:37:10 -0400",
"msg_from": "Doug McNaught <doug@wireboard.com>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "Neil Conway wrote:\n> Greg Copeland <greg@CopelandConsulting.Net> writes:\n> > On Thu, 2002-09-26 at 16:03, Neil Conway wrote:\n> > > I'm not really familiar with the reasoning behind ext2's\n> > > reputation as recovering poorly from crashes; if we fsync a WAL\n> > > record to disk before we lose power, can't we recover reliably,\n> > > even with ext2?\n> > \n> > Well, I have experienced data loss from ext2 before. Also, recovery\n> > from crashes on large file systems take a very, very long time.\n> \n> Yes, but wouldn't you face exactly the same issues if you ran a\n> UFS-like filesystem in asynchronous mode? Albeit it's not the default,\n> but performance in synchronous mode is usually pretty poor.\n\nYes, before UFS had soft updates, the synchronous nature of UFS made it\nslower than ext2, but now with soft updates, that performance difference\nis gone so you have two files systems, ext2 and ufs, similar peformance,\nbut one is crash-safe and the other is not.\n\nAnd, when comparing the journalling file systems, you have UFS vs.\nXFS/ext3/JFS/Reiser, and UFS is faster. The only thing the journalling\nfile system give you is more rapid reboot, but frankly, if your OS goes\ndown often enough so that is an issue, you have bigger problems than\nfsync time.\n\nThe big problem is that Linux went from non-crash safe right to\ncrash-safe and reboot quick. We need a middle ground, which is where\nUFS/soft updates is.\n\n> The fact that ext2 defaults to asynchronous mode and UFS (at least on\n> the BSDs) defaults to synchronous mode seems like a total non-issue to\n> me. Is there any more to the alleged difference in reliability?\n\nThe reliability problem isn't alleged. ext2 developers admits ext2\nisn't 100% crash-safe. They will say it is usually crash-safe, but that\nisn't good enough for PostgreSQL.\n\nI wish I was wrong.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 359-1001\n + If your life is a hard drive, | 13 Roberts Road\n + Christ can be your backup. | Newtown Square, Pennsylvania 19073\n",
"msg_date": "Thu, 26 Sep 2002 17:39:14 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "Doug McNaught wrote:\n> Tom Lane <tgl@sss.pgh.pa.us> writes:\n> \n> > We'd be happiest with a filesystem that journals its own metadata and\n> > not the user data in the file(s). I dunno if there are any.\n> \n> ext3 with data=writeback? (See my previous message to Bruce).\n\nOK, so that makes ext3 crash safe without lots of overhead?\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 359-1001\n + If your life is a hard drive, | 13 Roberts Road\n + Christ can be your backup. | Newtown Square, Pennsylvania 19073\n",
"msg_date": "Thu, 26 Sep 2002 17:41:22 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "On Thu, 2002-09-26 at 17:39, Bruce Momjian wrote:\n> Neil Conway wrote:\n> > Greg Copeland <greg@CopelandConsulting.Net> writes:\n> > > On Thu, 2002-09-26 at 16:03, Neil Conway wrote:\n> > > > I'm not really familiar with the reasoning behind ext2's\n> > > > reputation as recovering poorly from crashes; if we fsync a WAL\n> > > > record to disk before we lose power, can't we recover reliably,\n> > > > even with ext2?\n> > > \n> > > Well, I have experienced data loss from ext2 before. Also, recovery\n> > > from crashes on large file systems take a very, very long time.\n> > \n> > Yes, but wouldn't you face exactly the same issues if you ran a\n> > UFS-like filesystem in asynchronous mode? Albeit it's not the default,\n> > but performance in synchronous mode is usually pretty poor.\n> \n> Yes, before UFS had soft updates, the synchronous nature of UFS made it\n> slower than ext2, but now with soft updates, that performance difference\n> is gone so you have two files systems, ext2 and ufs, similar peformance,\n> but one is crash-safe and the other is not.\n\nNote entirely true. ufs is both crash-safe and quick-rebootable. You\ndo need to fsck at some point, but not prior to mounting it. Any\ncorrupt blocks are empty, and are easy to avoid.\n\nSomeone just needs to implement a background fsck that will run on a\nmounted filesystem.\n\n-- \n Rod Taylor\n\n",
"msg_date": "26 Sep 2002 17:45:23 -0400",
"msg_from": "Rod Taylor <rbt@rbt.ca>",
"msg_from_op": false,
"msg_subject": "Re: [GENERAL] Performance while loading data and indexing"
},
{
"msg_contents": "Rod Taylor wrote:\n> > Yes, before UFS had soft updates, the synchronous nature of UFS made it\n> > slower than ext2, but now with soft updates, that performance difference\n> > is gone so you have two files systems, ext2 and ufs, similar peformance,\n> > but one is crash-safe and the other is not.\n> \n> Note entirely true. ufs is both crash-safe and quick-rebootable. You\n> do need to fsck at some point, but not prior to mounting it. Any\n> corrupt blocks are empty, and are easy to avoid.\n\nI am assuming you need to mount the drive as part of the reboot. Of\ncourse you can boot fast with any file system if you don't have to mount\nit. :-)\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 359-1001\n + If your life is a hard drive, | 13 Roberts Road\n + Christ can be your backup. | Newtown Square, Pennsylvania 19073\n",
"msg_date": "Thu, 26 Sep 2002 17:47:43 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "On Thu, 2002-09-26 at 17:47, Bruce Momjian wrote:\n> Rod Taylor wrote:\n> > > Yes, before UFS had soft updates, the synchronous nature of UFS made it\n> > > slower than ext2, but now with soft updates, that performance difference\n> > > is gone so you have two files systems, ext2 and ufs, similar peformance,\n> > > but one is crash-safe and the other is not.\n> > \n> > Note entirely true. ufs is both crash-safe and quick-rebootable. You\n> > do need to fsck at some point, but not prior to mounting it. Any\n> > corrupt blocks are empty, and are easy to avoid.\n> \n> I am assuming you need to mount the drive as part of the reboot. Of\n> course you can boot fast with any file system if you don't have to mount\n> it. :-)\n\nSorry, poor explanation.\n\nBackground fsck (when implemented) would operate on a currently mounted\n(and active) file system. The only reason fsck is required prior to\nreboot now is because no-one had done the work.\n\nhttp://www.freebsd.org/cgi/man.cgi?query=fsck&sektion=8&manpath=FreeBSD+5.0-current\n\nSee the first paragraph of the above.\n-- \n Rod Taylor\n\n",
"msg_date": "26 Sep 2002 18:03:36 -0400",
"msg_from": "Rod Taylor <rbt@rbt.ca>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "Rod Taylor wrote:\n> On Thu, 2002-09-26 at 17:47, Bruce Momjian wrote:\n> > Rod Taylor wrote:\n> > > > Yes, before UFS had soft updates, the synchronous nature of UFS made it\n> > > > slower than ext2, but now with soft updates, that performance difference\n> > > > is gone so you have two files systems, ext2 and ufs, similar peformance,\n> > > > but one is crash-safe and the other is not.\n> > > \n> > > Note entirely true. ufs is both crash-safe and quick-rebootable. You\n> > > do need to fsck at some point, but not prior to mounting it. Any\n> > > corrupt blocks are empty, and are easy to avoid.\n> > \n> > I am assuming you need to mount the drive as part of the reboot. Of\n> > course you can boot fast with any file system if you don't have to mount\n> > it. :-)\n> \n> Sorry, poor explanation.\n> \n> Background fsck (when implemented) would operate on a currently mounted\n> (and active) file system. The only reason fsck is required prior to\n> reboot now is because no-one had done the work.\n> \n> http://www.freebsd.org/cgi/man.cgi?query=fsck&sektion=8&manpath=FreeBSD+5.0-current\n> \n> See the first paragraph of the above.\n\nOh, yes, I have heard of that missing feature.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 359-1001\n + If your life is a hard drive, | 13 Roberts Road\n + Christ can be your backup. | Newtown Square, Pennsylvania 19073\n",
"msg_date": "Thu, 26 Sep 2002 18:04:52 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "Bruce Momjian <pgman@candle.pha.pa.us> writes:\n\n> Doug McNaught wrote:\n> > Tom Lane <tgl@sss.pgh.pa.us> writes:\n> > \n> > > We'd be happiest with a filesystem that journals its own metadata and\n> > > not the user data in the file(s). I dunno if there are any.\n> > \n> > ext3 with data=writeback? (See my previous message to Bruce).\n> \n> OK, so that makes ext3 crash safe without lots of overhead?\n\nMetadata is journaled so you shouldn't lose data blocks or directory\nentries. Some data blocks (that haven't been fsync()'ed) may have old\nor wrong data in them, but I think that's the same as ufs, right? And\nWAL replay should take care of that.\n\nIt'd be very interesting to do some tests of the various journaling\nmodes. I have an old K6 that I might be able to turn into a\nhit-the-reset-switch-at-ramdom-times machine. What kind of tests\nshould be run?\n\n-Doug\n",
"msg_date": "26 Sep 2002 19:26:03 -0400",
"msg_from": "Doug McNaught <doug@wireboard.com>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "Doug McNaught <doug@wireboard.com> writes:\n> \"data=writeback\" means that no data is journaled, just metadata (which\n> is like XFS or Reiser). An fsync() call should still do what it\n> normally does, commit the writes to disk before returning.\n> \"data=journal\" journals all data and is the slowest and safest.\n> \"data=ordered\" writes out data blocks before committing a journal\n> transaction, which is faster than full data journaling (since data\n> doesn't get written twice) and almost as safe. \"data=writeback\" is\n> noted to keep obsolete data in the case of some crashes (since the\n> data may not have been written yet) but a completed fsync() should\n> ensure that the data is valid.\n\nThanks for the explanation.\n\n> So I guess I'd probably use data=ordered for an all-on-one-fs\n> installation, and data=writeback for a WAL-only drive.\n\nActually I think the ideal thing for Postgres would be data=writeback\nfor both data and WAL drives. We can handle loss of un-fsync'd data\nfor ourselves in both cases.\n\nOf course, if you keep anything besides Postgres data files on a\npartition, you'd possibly want the more secure settings.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 26 Sep 2002 23:07:44 -0400",
"msg_from": "Tom Lane <tgl@sss.pgh.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing "
},
{
"msg_contents": "Hello!\n\nOn Thu, 26 Sep 2002, Bruce Momjian wrote:\n\n> > I'm not really familiar with the reasoning behind ext2's reputation as\n> > recovering poorly from crashes; if we fsync a WAL record to disk\n\nOn relatively big volumes ext2 recovery can end up in formatting the fs \nunder certain cirrumstances.;-)\n\n> > > I assumed it was the double fsync for the normal and journal that\n> > > made the journalling file systems slog.\n> > \n> > Well, a journalling file system would need to write a journal entry\n> > and flush that to disk, even if fsync is disabled -- whereas without\n> > fsync enabled, ext2 doesn't have to flush anything to disk. ISTM that\n> > the performance advantage of ext2 over ext3 is should be even larger\n> > when fsync is not enabled.\n> \n> Yes, it is still double-writing. I just thought that if that wasn't\n> happening while the db was waiting for a commit that it wouldn't be too\n> bad.\n> \n> Is it just me or do all the Linux file systems seem like they are\n> lacking something when PostgreSQL is concerned? We just want a UFS-like\n> file system on Linux and no one has it.\n\nmount -o sync an ext2 volume on Linux - and you can get a \"UFS-like\" fs.:)\nmount -o async an FFS volume on FreeBSD - and you can get boost in fs \nperformance.\nPersonally me always mount ext2 fs where Pg is living with sync option.\nFsync in pg is off (since 6.3), this way successfully pass thru a few \nserious crashes on various systems (mostly on power problems).\nIf fsync is on in Pg, performance gets so-oh-oh-oh-oh slowly!=)\nI just have done upgrade from 2.2 kernel on ext2 to ext3 capable 2.4 one\nso I'm planning to do some benchmarking. Roughly saying w/o benchmarks, \nthe performance have been degraded in 2/3 proportion.\n\"But better safe then sorry\".\n\n-- \nWBR, Yury Bokhoncovich, Senior System Administrator, NOC of F1 Group.\nPhone: +7 (3832) 106228, ext.140, E-mail: byg@center-f1.ru.\nUnix is like a wigwam -- no Gates, no Windows, and an Apache inside.\n\n\n",
"msg_date": "Fri, 27 Sep 2002 12:14:40 +0700 (NOVST)",
"msg_from": "Yury Bokhoncovich <byg@center-f1.ru>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "neilc@samurai.com (Neil Conway) writes:\n\n[snip]\n> > Well, I have experienced data loss from ext2 before. Also, recovery\n> > from crashes on large file systems take a very, very long time.\n> \n> Yes, but wouldn't you face exactly the same issues if you ran a\n> UFS-like filesystem in asynchronous mode? Albeit it's not the default,\n> but performance in synchronous mode is usually pretty poor.\n> \n> The fact that ext2 defaults to asynchronous mode and UFS (at least on\n> the BSDs) defaults to synchronous mode seems like a total non-issue to\n> me. Is there any more to the alleged difference in reliability?\n\nUFS on most unix systems (BSD, solaris etc) defaults to sync\nmetadata, async data which is a mode that is completely missing\nfrom ext2 as far as I know.\n\nThis is why UFS is considered safer than ext2. (Running with\n'sync' is too slow to be a usable alternative in most cases.)\n\n _\nMats Lofkvist\nmal@algonet.se\n\n\nPS The BSD soft updates yields the safety of the default sync\n metadata / async data mode while being at least as fast as\n running fully async.\n",
"msg_date": "27 Sep 2002 12:40:13 +0200",
"msg_from": "Mats Lofkvist <mal@algonet.se>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
},
{
"msg_contents": "shridhar_daithankar@persistent.co.in (\"Shridhar Daithankar\") writes:\n\n[snip]\n> \n> Couple MB of data per sec. to disk is just not saturating it. It's a RAID 5 \n> setup..\n> \n\nRAID5 is not the best for performance, especially write performance.\nIf it is software RAID it is even worse :-).\n\n(Note also that you need to check that you are not saturating the\nnumber of seeks the disks can handle, not just the bandwith.)\n\nStriping should be better (combined with mirroring if you need the\nsafety, but with both striping and mirroring you may need multiple\nSCSI channels).\n\n _\nMats Lofkvist\nmal@algonet.se\n",
"msg_date": "27 Sep 2002 12:49:17 +0200",
"msg_from": "Mats Lofkvist <mal@algonet.se>",
"msg_from_op": false,
"msg_subject": "Re: Performance while loading data and indexing"
},
{
"msg_contents": "On 27 Sep 2002, Mats Lofkvist wrote:\n\n> shridhar_daithankar@persistent.co.in (\"Shridhar Daithankar\") writes:\n> \n> [snip]\n> > \n> > Couple MB of data per sec. to disk is just not saturating it. It's a RAID 5 \n> > setup..\n> > \n> \n> RAID5 is not the best for performance, especially write performance.\n> If it is software RAID it is even worse :-).\n\nI take exception to this. RAID5 is a great choice for most folks.\n\n1: RAID5 only writes out the parity stripe and data stripe, not all \nstripes when writing. So, in an 8 disk RAID5 array, writing to a single \n64 k stripe involves one 64k read (parity stripe) and two 64k writes.\n\nOn a mirror set, writing to one 64k stripe involves two 64k writes. The \ndifference isn't that great, and in my testing, a large enough RAID5 \nprovides so much faster read speads by spreading the reads across so many \nheads as to more than make up for the slightly slower writes. My testing \nhas shown that a 4 disk RAID5 can generally run about 85% or more the \nspeed of a mirror set.\n\n2: Why does EVERYONE have to jump on the bandwagon that software RAID 5 \nis bad. My workstation running RH 7.2 uses about 1% of the CPU during \nvery heavy parallel access (i.e. 50 simo pgbenchs) at most. I've seen \nmany hardware RAID cards that are noticeable slower than my workstation \nrunning software RAID. You do know that hardware RAID is just software \nRAID where the processing is done on a seperate CPU on a card, but it's \nstill software doing the work.\n\n3: We just had a hardware RAID card mark both drives in a mirror set bad. \nIt wouldn't accept them back, and all the data was gone. poof. That \nwould never happen in Linux's kernel software RAID, I can always make \nLinux take back a \"bad\" drive.\n\n\nThe only difference between RAID5 with n+1 disks and RAID0 with n disks is \nthat we have to write a parity stripe in RAID5. It's ability to handle \nhigh parallel load is much better than a RAID1 set, and on average, you \nactually write about the same amount with either RAID1 or RAID5.\n\nDon't dog software RAID5, it works and it works well in Linux. Windows, \nhowever, is another issue. There, the software RAID5 is pretty pitiful, \nboth in terms of performance and maintenance.\n\n",
"msg_date": "Fri, 27 Sep 2002 09:16:03 -0600 (MDT)",
"msg_from": "\"scott.marlowe\" <scott.marlowe@ihs.com>",
"msg_from_op": false,
"msg_subject": "Re: Performance while loading data and indexing"
},
{
"msg_contents": "Tom Lane <tgl@sss.pgh.pa.us> writes:\n\n> We'd be happiest with a filesystem that journals its own metadata and\n> not the user data in the file(s). I dunno if there are any.\n\nMost journalling file systems work this way. Data journalling is not\nvery widespread, AFAIK.\n\n-- \nFlorian Weimer \t Weimer@CERT.Uni-Stuttgart.DE\nUniversity of Stuttgart http://CERT.Uni-Stuttgart.DE/people/fw/\nRUS-CERT fax +49-711-685-5898\n",
"msg_date": "Fri, 27 Sep 2002 21:01:38 +0200",
"msg_from": "Florian Weimer <Weimer@CERT.Uni-Stuttgart.DE>",
"msg_from_op": false,
"msg_subject": "Re: [GENERAL] Performance while loading data and indexing"
},
{
"msg_contents": "scott.marlowe wrote:\n\n>(snippage)\n>I take exception to this. RAID5 is a great choice for most folks.\n>\n>\nI agree - certainly RAID5 *used* to be rather sad, but modern cards have \nimproved this no end on the hardware side - e.g.\n\nI recently benchmarked a 3Ware 8x card on a system with 4 x 15000 rpm \nMaxtor 70Gb drives and achieved 120 Mb/s for (8K) reads and 60 Mb/s for \n(8K) writes using RAID5. I used Redhat 7.3 + ext2. The benchmarking \nprogram was Bonnie.\n\nGiven that the performance of a single disk was ~30 Mb/s for reads and \nwrites, I felt this was quite a good result ! ( Other cards I had tried \npreviously struggled to maintain 1/2 the write rate of a single disk in \nsuch a configuration).\n\nAs for software RAID5, I have not tried it out.\n\nOf course I could not get 60Mb/s while COPYing data into Postgres... \ntypically cpu seemed to be the bottleneck in this case (what was the \nactual write rate? I hear you asking..err.. cant recall I'm afraid.. \nmust try it out again )\n\ncheers\n\nMark\n\n",
"msg_date": "Sat, 28 Sep 2002 13:38:52 +1200",
"msg_from": "Mark Kirkwood <markir@paradise.net.nz>",
"msg_from_op": false,
"msg_subject": "Re: Performance while loading data and indexing"
},
{
"msg_contents": "Some of you may be interested in this seemingly exhaustive benchmark\nbetween ext2/3, ReiserFS, JFS, and XFS.\n\nhttp://www.osdl.org/presentations/lwe-jgfs.pdf\n\n\n",
"msg_date": "03 Oct 2002 16:09:56 -0700",
"msg_from": "Mike Benoit <mikeb@netnation.com>",
"msg_from_op": false,
"msg_subject": "Re: [GENERAL] Performance while loading data and indexing"
},
{
"msg_contents": "Hey, excellent. Thanks!\n\nBased on that, it appears that XFS is a pretty good FS to use. For me,\nthe real surprise was how well reiserfs performed.\n\nGreg\n\nOn Thu, 2002-10-03 at 18:09, Mike Benoit wrote:\n> Some of you may be interested in this seemingly exhaustive benchmark\n> between ext2/3, ReiserFS, JFS, and XFS.\n> \n> http://www.osdl.org/presentations/lwe-jgfs.pdf\n> \n> \n> \n> ---------------------------(end of broadcast)---------------------------\n> TIP 6: Have you searched our list archives?\n> \n> http://archives.postgresql.org",
"msg_date": "03 Oct 2002 18:35:34 -0500",
"msg_from": "Greg Copeland <greg@CopelandConsulting.Net>",
"msg_from_op": false,
"msg_subject": "Re: [GENERAL] Performance while loading data and indexing"
},
{
"msg_contents": "Greg Copeland wrote:\n-- Start of PGP signed section.\n> Hey, excellent. Thanks!\n> \n> Based on that, it appears that XFS is a pretty good FS to use. For me,\n> the real surprise was how well reiserfs performed.\n> \n\nOK, hardware performance paper updated:\n\n---------------------------------------------------------------------------\n\nFile system choice is particularly difficult on Linux because there are\nso many file system choices, and none of them are optimal: ext2 is not\nentirely crash-safe, ext3, xfs, and jfs are journal-based, and Reiser is\noptimized for small files and does journalling. The journalling file\nsystems can be significantly slower than ext2 but when crash recovery is\nrequired, ext2 isn't an option. If ext2 must be used, mount it with sync\nenabled. Some people recommend xfs or an ext3 filesystem mounted with\ndata=writeback.\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\n pgman@candle.pha.pa.us | (610) 359-1001\n + If your life is a hard drive, | 13 Roberts Road\n + Christ can be your backup. | Newtown Square, Pennsylvania 19073\n",
"msg_date": "Thu, 3 Oct 2002 19:59:56 -0400 (EDT)",
"msg_from": "Bruce Momjian <pgman@candle.pha.pa.us>",
"msg_from_op": false,
"msg_subject": "Re: [GENERAL] Performance while loading data and indexing"
},
{
"msg_contents": "On 26 Sep 2002, Neil Conway wrote:\n\n> The fact that ext2 defaults to asynchronous mode and UFS (at least on\n> the BSDs) defaults to synchronous mode seems like a total non-issue to\n> me. Is there any more to the alleged difference in reliability?\n\nIt was sort of pointed out here, but perhaps not made completely\nclear, that Berkley FFS defaults to synchronous meta-data updates,\nbut asynchronous data updates. You can also specify entirely\nsynchronous or entirely asynchronous updates. Linux ext2fs supports\nonly these last two modes, which is the problem.\n\ncjs\n-- \nCurt Sampson <cjs@cynic.net> +81 90 7737 2974 http://www.netbsd.org\n Don't you know, in this new Dark Age, we're all light. --XTC\n\n",
"msg_date": "Mon, 7 Oct 2002 00:52:24 +0900 (JST)",
"msg_from": "Curt Sampson <cjs@cynic.net>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Performance while loading data and indexing"
}
] |
[
{
"msg_contents": "According to ext3 hackers (Stephen Tweedie, Andrew Morton). ext3\ndata=journal mode is much faster than any of the other mode for\nworkloads which do a lot of syncrhonous i/o. Personally, I have seen\ndramatic improvements on moving mail queues to this mode (postfix in\nparticularly flies with this mode)\n\nWhile this may seem contradictory (forcing journaling for the data in\naddition to the metadata), it will likely improve the performance for\nsync I/O loads like mail servers because it can do all of the I/O to the\njournal without any seek or sync overhead while the mail is arriving.\n\nI assume that since Postgresql does a lot of fsyncs, it would benefit\nalso. I have sent email to Sridhar asking if he could test this\n\nAnother thing to note is that Linux 2.4.x kernels < 2.4.20-pre4 use\nbounce buffer's to do IO if the machine has > 1GB memory. Distributor\nkernels such as Redhat/Suse/Mandrake are patched to do IO via DMA\nto/from highmem (>1GB). According to IBM's paper @ OLS, this improves IO\nperformance by 40%\n\nBTW, Is this list archived on the website\n\nRegards, Yusuf\n-- \nYusuf Goolamabbas\nyusufg@outblaze.com\n",
"msg_date": "Fri, 27 Sep 2002 10:55:10 +0800",
"msg_from": "Yusuf Goolamabbas <yusufg@outblaze.com>",
"msg_from_op": true,
"msg_subject": "Would ext3 data=journal help for Postgres synchronous io mode"
}
] |
[
{
"msg_contents": "subscribe\n-- \nsecure email with gpg http://fortytwo.ch/gpg\n\nNOTICE: subkey signature! request key 92082481 from keyserver.kjsl.com\n",
"msg_date": "27 Sep 2002 11:42:22 +0200",
"msg_from": "Adrian von Bidder <avbidder@fortytwo.ch>",
"msg_from_op": true,
"msg_subject": ""
}
] |
[
{
"msg_contents": "When a table is created with a primary key it generates a index.\nDos the queries on that table use that index automatically?\nDo I need to reindex that index after insertions?\n\n\n\n\n\n\n\nWhen a table is created with a primary key it \ngenerates a index.\nDos the queries on that table use that index \nautomatically?\nDo I need to reindex that index after \ninsertions?",
"msg_date": "Sat, 28 Sep 2002 21:50:13 +0600",
"msg_from": "\"Waruna Geekiyanage\" <waruna@nirmani.com>",
"msg_from_op": true,
"msg_subject": "INDEX"
},
{
"msg_contents": "On Sat, Sep 28, 2002 at 09:50:13PM +0600, Waruna Geekiyanage wrote:\n> When a table is created with a primary key it generates a index.\n> Dos the queries on that table use that index automatically?\n\nOnly if you analyse the table, and it's a \"win\". See the various\npast discussion on -general, for instance, about index use, and the\nFAQ.\n\n> Do I need to reindex that index after insertions?\n\nNo, but you need to analyse.\n\nA\n\n-- \n----\nAndrew Sullivan 204-4141 Yonge Street\nLiberty RMS Toronto, Ontario Canada\n<andrew@libertyrms.info> M2P 2A8\n +1 416 646 3304 x110\n\n",
"msg_date": "Sat, 28 Sep 2002 15:13:18 -0400",
"msg_from": "Andrew Sullivan <andrew@libertyrms.info>",
"msg_from_op": false,
"msg_subject": "Re: INDEX"
}
] |
[
{
"msg_contents": "On Tue, 1 Oct 2002, Adam Siegel wrote:\n\n> I have a table that has about 200 rows in it. I have 2 other tables\n> that have about 300,000 rows each that reference the first table\n> through a foriegn key. I run a process that rebuilds these tables.\n> First I delete the rows in the large tables (takes about 30 seconds),\n> then I delete the the rows in the first table (takes about 5 minutes\n> !!!). Each of these are done in separate transactions.\n>\n> If I do a vacuum analyze on each of the large tables just after the\n> delete then deleting the rows from the first table takes just a second\n> or two. My guess is that postgres is still check the foriegn keys\n> from the first table to the others even though the records are deleted\n> in the larger tables. The vacuum cleans up the deleted records, so it\n> goes faster. Am I wrong. Any ideas?\n\nThat seems reasonable. It's still going to be doing some action on those\ntables and it's going to have to scan the tables in some case. It's wierd\nthat it's taking that long to do it in any case however, what does the\nschema for the tables look like?\n\n\n\n",
"msg_date": "Tue, 1 Oct 2002 11:27:56 -0700 (PDT)",
"msg_from": "Stephan Szabo <sszabo@megazone23.bigpanda.com>",
"msg_from_op": true,
"msg_subject": "Re: [pgsql-performance] Deletes from tables with foreign keys taking"
},
{
"msg_contents": "I have a table that has about 200 rows in it. I have 2 other tables that have about 300,000 rows each that reference the first table through a foriegn key. I run a process that rebuilds these tables. First I delete the rows in the large tables (takes about 30 seconds), then I delete the the rows in the first table (takes about 5 minutes !!!). Each of these are done in separate transactions.\n\nIf I do a vacuum analyze on each of the large tables just after the delete then deleting the rows from the first table takes just a second or two. My guess is that postgres is still check the foriegn keys from the first table to the others even though the records are deleted in the larger tables. The vacuum cleans up the deleted records, so it goes faster. Am I wrong. Any ideas?\n\nRegards,\nAdam\n\n\n\n\n\n\n\n\n\nI have a table that has about 200 rows in it. \nI have 2 other tables that have about 300,000 rows each that reference the first \ntable through a foriegn key. I run a process that rebuilds these \ntables. First I delete the rows in the large tables (takes about 30 \nseconds), then I delete the the rows in the first table (takes about 5 minutes \n!!!). Each of these are done in separate transactions.\n \nIf I do a vacuum analyze on each of the large \ntables just after the delete then deleting the rows from the first table takes \njust a second or two. My guess is that postgres is still check the foriegn \nkeys from the first table to the others even though the records are deleted in \nthe larger tables. The vacuum cleans up the deleted records, so it goes \nfaster. Am I wrong. Any ideas?\n \nRegards,\nAdam",
"msg_date": "Tue, 1 Oct 2002 14:28:04 -0400",
"msg_from": "\"Adam Siegel\" <adam@sycamorehq.com>",
"msg_from_op": false,
"msg_subject": "Deletes from tables with foreign keys taking too long"
},
{
"msg_contents": "Adam,\n\n> I have a table that has about 200 rows in it. I have 2 other tables that\n> have about 300,000 rows each that reference the first table through a\n> foriegn key. I run a process that rebuilds these tables. First I delete\n> the rows in the large tables (takes about 30 seconds), then I delete the\n> the rows in the first table (takes about 5 minutes !!!). Each of these are\n> done in separate transactions.\n\nNot that this answers your performance questions, but you will be able to do \nthis faster if you use TRUNCATE instead of DELETE.\n\n-- \nJosh Berkus\njosh@agliodbs.com\nAglio Database Solutions\nSan Francisco\n",
"msg_date": "Tue, 1 Oct 2002 14:44:05 -0700",
"msg_from": "Josh Berkus <josh@agliodbs.com>",
"msg_from_op": false,
"msg_subject": "Re: [pgsql-performance] Deletes from tables with foreign keys taking\n\ttoo long"
}
] |
[
{
"msg_contents": "Relative performance question:\n\nI have 2 UPDATE queires in a function. \n\ntable_a: 117,000 records\ntable_b: 117,000 records\ntable_c: 1.5 million records\n\n #1 updates table_a, field_2 from table_b, field_1 based on a joining field_3. \nAround 110,000 updates\n#2 updates table_a, field_5 from table_c, field_2 joining on field_3. \nAround 110,000 updates.\n\n#1 takes 5-7 minutes; #2 takes about 15 seconds. The only difference I can \ndiscern is that table_a, field_2 is indexed and table_a, field_5 is not.\n\nIs it reasonable that updating the index would actually make the query take \n20x longer? If not, I'll post actual table defs and query statements.\n\n-- \nJosh Berkus\njosh@agliodbs.com\nAglio Database Solutions\nSan Francisco\n",
"msg_date": "Tue, 1 Oct 2002 14:51:29 -0700",
"msg_from": "Josh Berkus <josh@agliodbs.com>",
"msg_from_op": true,
"msg_subject": "Comparitive UPDATE speed"
},
{
"msg_contents": "On Tue, 2002-10-01 at 16:51, Josh Berkus wrote:\n> Relative performance question:\n> \n> I have 2 UPDATE queires in a function. \n> \n> table_a: 117,000 records\n> table_b: 117,000 records\n> table_c: 1.5 million records\n> \n> #1 updates table_a, field_2 from table_b, field_1 based on a joining field_3. \n> Around 110,000 updates\n> #2 updates table_a, field_5 from table_c, field_2 joining on field_3. \n> Around 110,000 updates.\n> \n> #1 takes 5-7 minutes; #2 takes about 15 seconds. The only difference I can \n> discern is that table_a, field_2 is indexed and table_a, field_5 is not.\n> \n> Is it reasonable that updating the index would actually make the query take \n> 20x longer? If not, I'll post actual table defs and query statements.\n\nAbsolutely. You are doing lots of extra work. \n\nFor each of the 110,000 updates, you are deleting a leaf node from one\npart of the index tree and then inserting it into another part of the\ntree.\n\nIt will get even worse as you add more rows to table_a, since the\nindex tree will get deeper, and more work work must be done during\neach insert and delete.\n\n-- \n+------------------------------------------------------------+\n| Ron Johnson, Jr. mailto:ron.l.johnson@cox.net |\n| Jefferson, LA USA http://members.cox.net/ron.l.johnson |\n| |\n| \"What other evidence do you have that they are terrorists, |\n| other than that they trained in these camps?\" |\n| 17-Sep-2002 Katie Couric to an FBI agent regarding the 5 |\n| men arrested near Buffalo NY |\n+------------------------------------------------------------+\n\n",
"msg_date": "02 Oct 2002 05:48:01 -0500",
"msg_from": "Ron Johnson <ron.l.johnson@cox.net>",
"msg_from_op": false,
"msg_subject": "Re: Comparitive UPDATE speed"
}
] |
[
{
"msg_contents": "\nRandy,\n\n> I'm not sure about 20 times longer but you would have index records\n> that \n> would need to be changed. Is field_3 indexed in all 3 tables? If\n> table_b \n> does not have an index on field_3 and the other tables do, I'd guess\n> that \n> would make this take longer too.\n\nYeah, they're indexed. I'm going to try the updates without the index\non field_2 tonight.\n\n-Josh Berkus\n",
"msg_date": "Tue, 01 Oct 2002 16:50:21 -0700",
"msg_from": "\"Josh Berkus\" <josh@agliodbs.com>",
"msg_from_op": true,
"msg_subject": "Re: Comparitive UPDATE speed"
}
] |
End of preview. Expand
in Dataset Viewer.
README.md exists but content is empty.
Use the Edit dataset card button to edit it.
- Downloads last month
- 70