From achambers at mcna.net Thu Dec 9 16:59:06 2010 From: achambers at mcna.net (Andy Chambers) Date: Thu, 09 Dec 2010 11:59:06 -0500 Subject: [postmodern-devel] Minimum overhead per query Message-ID: Hi, We're finding that even very simple queries (e.g. "select 1;") take around 220ms to return a result. The same query is reported as taking ~120ms on pgAdmin which suggests a postmodern overhead of around 100ms per query. Does this sound right to others on the list? Is there any way to reduce this overhead for applications that may generate lots of small simple queries? Cheers, Andy -- Andy Chambers From xach at xach.com Thu Dec 9 17:05:38 2010 From: xach at xach.com (Zach Beane) Date: Thu, 09 Dec 2010 12:05:38 -0500 Subject: [postmodern-devel] Minimum overhead per query In-Reply-To: (Andy Chambers's message of "Thu, 09 Dec 2010 11:59:06 -0500") References: Message-ID: <87oc8ukhb1.fsf@hangup.portland.xach.com> "Andy Chambers" writes: > Hi, > > We're finding that even very simple queries (e.g. "select 1;") take around > 220ms to return a result. The same query is reported as taking ~120ms on > pgAdmin which suggests a postmodern overhead of around 100ms per query. > Does this sound right to others on the list? Is there any way to reduce > this overhead for applications that may generate lots of small simple > queries? Doesn't sound right to me. I'm connecting to a Postgres server on the local network. (postmodern:query "select 1") returns in 1ms with the expected answer. Are you including the time to establish a connection, or something? Zach From marijnh at gmail.com Thu Dec 9 18:24:52 2010 From: marijnh at gmail.com (Marijn Haverbeke) Date: Thu, 9 Dec 2010 19:24:52 +0100 Subject: [postmodern-devel] Minimum overhead per query In-Reply-To: References: Message-ID: 100 ms overhead for a tiny query sounds very wrong. I just tried this out as well -- (time (query (:select 1))) -- and am seeing about .8 milliseconds average. If such a query from another tool is also taking 120ms, I think you should look for the problem in your server, since this shouldn't be taking that long, not even on 1990-era hardware. Best, Marijn From slobodan.milnovic at gmail.com Sat Dec 11 10:23:47 2010 From: slobodan.milnovic at gmail.com (=?UTF-8?Q?Slobodan_Milnovi=C4=87?=) Date: Sat, 11 Dec 2010 11:23:47 +0100 Subject: [postmodern-devel] Selecting schema with dao-class Message-ID: Hi, I'm trying to find any documentation about selecting database schema with dao-class, for example something like this: (defclass my-class () ((some-column :column t :accessor some-column :initarg some-column) ..... itd)) (:metaclass postmodern:dao-class) (:table-name (:dot 'scheme-name 'table-name)) (:keys some-column)) But it seems (:dot 'scheme-name 'table-name) format is supported only in queries? How can I select an schema in database? From marijnh at gmail.com Sat Dec 11 11:17:56 2010 From: marijnh at gmail.com (Marijn Haverbeke) Date: Sat, 11 Dec 2010 12:17:56 +0100 Subject: [postmodern-devel] Selecting schema with dao-class In-Reply-To: References: Message-ID: > But it seems (:dot 'scheme-name 'table-name) format is supported only > in queries? How can I select an schema in database? The table-name has to be a string, and is not evaluated. You could just do (:table-name "schema_name.table_name"). Or use #.(sql (:dot 'foo 'bar)). From slobodan.milnovic at gmail.com Sat Dec 11 15:39:17 2010 From: slobodan.milnovic at gmail.com (=?UTF-8?Q?Slobodan_Milnovi=C4=87?=) Date: Sat, 11 Dec 2010 16:39:17 +0100 Subject: [postmodern-devel] Selecting schema with dao-class In-Reply-To: References: Message-ID: On Sat, Dec 11, 2010 at 12:17, Marijn Haverbeke wrote: >> But it seems (:dot 'scheme-name 'table-name) format is supported only >> in queries? How can I select an schema in database? > > The table-name has to be a string, and is not evaluated. You could > just do (:table-name "schema_name.table_name"). Or use #.(sql (:dot > 'foo 'bar)). Great, thank you!