Re: How to read query plan

From: Miroslav Šulc <miroslav(dot)sulc(at)startnet(dot)cz>
To: John Arbash Meinel <john(at)arbash-meinel(dot)com>
Cc: PGSQL mailing list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: How to read query plan
Date: 2005-03-13 19:51:05
Message-ID: 423499A9.5080504@startnet.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

John Arbash Meinel wrote:

> Is there a reason to use varchar(1) instead of char(1). There probably
> is 0 performance difference, I'm just curious.

No, not at all. I'm just not used to char().

> Well, with cursors you can also do "FETCH ABSOLUTE 1 FROM
> <cursor_name>", which sets the cursor position, and then you can "FETCH
> FORWARD 30".
> I honestly don't know how the performance will be, but it is something
> that you could try.

This is science for me at this moment :-)

>> For display of single page consisting of 30 rows. The reason I query
>> all rows is that this is one of the filters users can use. User can
>> display just bigboards or billboards (or specify more advanced
>> filters) but he/she can also display AdDevices without any filter
>> (page by page). Before I select the 30 row, I need to order them by a
>> key and after that select the records, so this is also the reason why
>> to ask for all rows. The key for sorting might be different for each
>> run.
>>
> How are you caching the information in the background in order to
> support paging? Since you aren't using limit/offset, and you don't seem
> to be creating a temporary table, I assume you have a layer inbetween
> the web server and the database (or possibly inside the webserver) which
> keeps track of current session information. Is that true?

I just need three information:
1) used filter (stored in session, identified by filter index in query
string)
2) page length (static predefined)
3) what page to display (in query string)

>> In fact, on MySQL I didn't see any slow reactions so I didn't measure
>> and inspect it. But I can try it if I figure out how to copy the
>> database from PostgreSQL to MySQL.
>
>
> I figured you still had a copy of the MySQL around to compare to. You
> probably don't need to spend too much time on it yet.

It's not so simple because there are some differences between MySQL and
PostgreSQL in how they handle case sensitivity etc. The database table
structures are not the same too because of different data types support
and data values support.

>
> John
> =:->

Miroslav

Attachment Content-Type Size
miroslav.sulc.vcf text/x-vcard 387 bytes

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-03-13 19:54:33 Re: How to read query plan
Previous Message Robert Creager 2005-03-13 19:48:00 Re: date_trunc problem in HEAD

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2005-03-13 19:54:33 Re: How to read query plan
Previous Message Miroslav Šulc 2005-03-13 19:43:58 Re: How to read query plan