I am using PostgreSQL 10 on windows 7 (64 bit) machine.I have a PostgreSQL table whose structure is given below.
CREATE TABLE public.linedata ( linedataid bigint NOT NULL, customerid integer NOT NULL, linelatlong geometry(LineString,4326), createdon date DEFAULT now() ) WITH ( OIDS = FALSE ) TABLESPACE pg_default; ALTER TABLE public.linedata OWNER to postgres; CREATE INDEX idx_linedata_customerid ON public.linedata USING btree (customerid) TABLESPACE pg_default; CREATE INDEX idx_linedata_linedataid ON public.linedata USING btree (linedataid) TABLESPACE pg_default; CREATE INDEX idx_linedata_geom ON public.linedata USING gist (linelatlong) TABLESPACE pg_default;
This table has 4333053 records. Geoserver call this table to get data and render layers. But the performance is very slow. Geoserver uses below given query.
Select pgis.linelatlong From public.linedata as pgis INNER JOIN public.tempLine as tdp ON tdp.templineid=pgis.linedataid where tdp.uniquedata=%drivepathid% AND pgis.linelatlong is not null
structure of templine table is given below.
CREATE TABLE public.tempLine ( templineid bigint, uniquedata bigint ) WITH ( OIDS = FALSE ) TABLESPACE pg_default; ALTER TABLE public.tempLine OWNER to postgres; CREATE INDEX idx_tempLine_uniquedata ON public.tempLine USING btree (uniquedata) TABLESPACE pg_default;
drivepathid is a viewparams. In the LineData table linedataid can be duplicate for a customer therefore did not set it as primary key.LineData table is populated from some external source. The above query returns 14652 records only and took 4-5 minutes. AutoVaccum and AutoAnalyze is set on this table.
Explain analyze and query is given below.
Select pgis.linelatlong From public.linedata as pgis INNER JOIN public.tempLine as tdp ON tdp.templineid=pgis.linedataid where tdp.uniquedata=1711058674182521921 AND pgis.linelatlong is not null
"Gather (cost=1000.43..226588.94 rows=50881 width=6588) (actual time=0.555..525.171 rows=14652 loops=1)" " Workers Planned: 2" " Workers Launched: 2" " -> Nested Loop (cost=0.43..220500.84 rows=21200 width=6588) (actual time=250.457..425.718 rows=4884 loops=3)" " -> Parallel Seq Scan on tempLine tdp (cost=0.00..121612.47 rows=6525 width=8) (actual time=250.411..415.384 rows=4884 loops=3)" " Filter: (uniquedata = '1711058674182521921'::bigint)" " Rows Removed by Filter: 3814396" " -> Index Scan using idx_linedata_linedataid on linedata pgis (cost=0.43..15.13 rows=3 width=6596) (actual time=0.002..0.002 rows=1 loops=14652)" " Index Cond: (drivepathid = tdp.drivepathid)" "Planning time: 0.256 ms" "Execution time: 530.261 ms"
Any Suggestion ?
✓ Extra quality
ExtraProxies brings the best proxy quality for you with our private and reliable proxies
✓ Extra anonymity
Top level of anonymity and 100% safe proxies – this is what you get with every proxy package
✓ Extra speed
1,ooo mb/s proxy servers speed – we are way better than others – just enjoy our proxies!
USA proxy location
We offer premium quality USA private proxies – the most essential proxies you can ever want from USA
Our proxies have TOP level of anonymity + Elite quality, so you are always safe and secure with your proxies
Use your proxies as much as you want – we have no limits for data transfer and bandwidth, unlimited usage!
Superb fast proxy servers with 1,000 mb/s speed – sit back and enjoy your lightning fast private proxies!
99,9% servers uptime
Alive and working proxies all the time – we are taking care of our servers so you can use them without any problems
No usage restrictions
You have freedom to use your proxies with every software, browser or website you want without restrictions
Perfect for SEO
We are 100% friendly with all SEO tasks as well as internet marketing – feel the power with our proxies
Buy more proxies and get better price – we offer various proxy packages with great deals and discounts
We are working 24/7 to bring the best proxy experience for you – we are glad to help and assist you!