<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;
        mso-fareast-language:NO-BOK;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;
        mso-fareast-language:NO-BOK;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Consolas",serif;
        color:black;
        mso-fareast-language:EN-US;}
span.EmailStyle22
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle23
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="NO-BOK" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">thanks for the response!<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">## What means "big" (how many records are you dealing with)?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">These are the sizes (number of records) of the main tables:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">- location (points) ~ 450 000<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">- event ~ 150 000<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">- occurrence ~ 270 000<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">## I know this sounds silly - but are your tables properly indexed (you<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">don't have to index primary keys, but other columns that are used in<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">relations need an index)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">There are indexes for the foreign keys of the main tables. Also all "controlled vocabulary" columns are indexed.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">Th referencing tables are usually smaller than 500 records.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">## What exact QGIS version are you using? 2.18.x - in the about dialogue<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">you can find this, including the exact github version string<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">I tried it with:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">- Ubuntu 16.04 (in virtual machine on Windows 10): 2.18.11 https://github.com/qgis/QGIS/commit/29548e7<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">- Windows 10: 2.18.11 https://github.com/qgis/QGIS/commit/29548e7<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">## How I set everything up<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">I created "relations" (location-event and event-occurrence) in the project properties.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">In the "fields" tab of the layers properties I also changed respective "edit widgets" to "Relation Reference".<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">For the controlled vocabulary I changed the "edit widgets" to "Value Relation" (I used the Autoform plugin https://github.com/sourcepole/AutoForm for it and checked it manually)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">I kept "Attribute editor layout" with the "Autogenerate" setting.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">## What I want to have:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">I want to be able to add new events (and occurrences) to locations.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">## What happens:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">When I want to create a new **location**, I have to wait for a few minutes. Then the input window pops up, but I cannot access it because QGIS has frozen.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">When I want to create a new **event**, an empty window opens, QGIS freezes and nothing happens for many minutes.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">When I want to create a new **occurrence**, the table opens slowly, but I can enter all necessary values and store it to the database.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">## Question:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">Can QGIS handle tables of the sizes mentioned above?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">Do you have an idea, what I could have done wrong?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext">I could also provide more information and maybe even a minimal example.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:windowtext"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">Thanks and best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:windowtext">Jakob<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="color:windowtext;mso-fareast-language:NO-BOK">From:</span></b><span lang="EN-US" style="color:windowtext;mso-fareast-language:NO-BOK"> Qgis-user [mailto:qgis-user-bounces@lists.osgeo.org]
<b>On Behalf Of </b>Andreas Neumann<br>
<b>Sent:</b> fredag 4. august 2017 09.39<br>
<b>To:</b> qgis-user@lists.osgeo.org<br>
<b>Subject:</b> Re: [Qgis-user] QGIS Input Form for PostGIS<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Hi Jakob,<span style="font-size:12.0pt;mso-fareast-language:NO-BOK"><o:p></o:p></span></p>
<p>I don't think there is much background information or documentation available on relations.<o:p></o:p></p>
<p>The obvious questions to you are:<o:p></o:p></p>
<p>- What means "big" (how many records are you dealing with)?<o:p></o:p></p>
<p>- I know this sounds silly - but are your tables properly indexed (you don't have to index primary keys, but other columns that are used in relations need an index)<o:p></o:p></p>
<p>- What exact QGIS version are you using? 2.18.x - in the about dialogue you can find this, including the exact github version string<o:p></o:p></p>
<p>- if we can't help you further, it may help to see your create table statements (including all indexes)<o:p></o:p></p>
<p>Andreas<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 03.08.2017 11:47, Jakob Miksch wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-GB">Hello,</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">I have a (rather big) Postgres/PostGIS database that basically looks like this:
<a href="https://ibb.co/bK7PKv">https://ibb.co/bK7PKv</a></span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">I want to use QGIS for editing and inserting data.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">I already found these ressources:</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"><a href="https://docs.qgis.org/2.18/en/docs/user_manual/working_with_vector/vector_properties.html#fields-properties">https://docs.qgis.org/2.18/en/docs/user_manual/working_with_vector/vector_properties.html#fields-properties</a></span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"><a href="https://docs.qgis.org/2.18/en/docs/user_manual/working_with_vector/attribute_table.html#creating-one-or-many-to-many-relations">https://docs.qgis.org/2.18/en/docs/user_manual/working_with_vector/attribute_table.html#creating-one-or-many-to-many-relations</a></span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"><a href="https://docs.qgis.org/2.18/en/docs/training_manual/create_vector_data/forms.html">https://docs.qgis.org/2.18/en/docs/training_manual/create_vector_data/forms.html</a></span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">I tried it: I created the relations and built custom forms.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">However, when I want to insert or edit something. QGIS becomes really slow and crashes finally. But before I describe the problems in more detail I want to read more about it. I find the documentation (linked above) a
 bit too little. </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">So, my question:</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">Is there any documentation I have missed?</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">Is there any book (chapter) you can recommend?</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">Do you know of any example where QGIS is used for entering data into many related tables in Postgres/PostGIS at once?</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB">I am thankful for any hint or resource.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><o:p></o:p></p>
<p class="MsoNormal">Jakob<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:NO-BOK"><br>
<br>
<br>
<o:p></o:p></span></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>Qgis-user mailing list<o:p></o:p></pre>
<pre><a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><o:p></o:p></pre>
<pre>List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><o:p></o:p></pre>
<pre>Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><o:p></o:p></pre>
</blockquote>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:NO-BOK"><o:p> </o:p></span></p>
</div>
</body>
</html>